Combine IF, AND and CHOOSE to display month name : IF « Logical functions « Microsoft Office Excel 2007 Tutorial






Input the formula: =IF(AND(A1>0,A1<13),CHOOSE(A1,"January", "February","March", "April", "May", "June", "July","August", "September", "October", "November", "December"),"That is not a month!")
Input the formula:








18.3.IF
18.3.1.IF(logical_test,value_if_true,value_if_false) specifies a logical testIF(logical_test,value_if_true,value_if_false) specifies a logical test
18.3.2.=IF(A2=100,SUM(B5:B15),"")=IF(A2=100,SUM(B5:B15),
18.3.3.=IF(A2>89,"A",IF(A2>79,"B", IF(A2>69,"C",IF(A2>59,"D","F"))))=IF(A2>89,79,"B", IF(A2>69,"C",IF(A2>59,"D","F"))))" src="http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/ifa2gt89aifa2gt79b_Ifa2gt69cifa2gt5___Input_Formula_ifa289aifa279b_Ifa269.PNG" width=200 height=40>
18.3.4.Combine IF, AND and CHOOSE to display month nameCombine IF, AND and CHOOSE to display month name
18.3.5.Combine IF, OR and CHOOSE to display month nameCombine IF, OR and CHOOSE to display month name
18.3.6.=IF(A1>A2, A1, A2): if the value in A1 is greater than the value in A2, then the value in A1 is returned. If not, then the value in A2 is returned.=IF(A1>A2, A1, A2): if the value in A1 is greater than the value in A2, then the value in A1 is returned. If not, then the value in A2 is returned.
18.3.7.=IF(A1>A2, "Good!", "Bad!"): if the value in A1 is greater than the value in A2, then the text "Good!" is returned. Otherwise "Bad!" is returned.=IF(A1>A2,