B brianaclark1967 Member Apr 29, 2015 #1 Hi Guys, I'm trying to get an if statement to work. Please see attached sheet. How many arguments can you put in an IF statement? Regards Brian Attachments formula query.xlsx formula query.xlsx 8.8 KB · Views: 2
Hi Guys, I'm trying to get an if statement to work. Please see attached sheet. How many arguments can you put in an IF statement? Regards Brian
Luke M Excel Ninja Staff member Apr 29, 2015 #2 The IF function takes 3 arguments: Logic Test, Value if True, Value if False I think you are wanting to see if D4 is in either of two lists. We can check that with a couple of IF functions, as the 3 possible outputs are: It's in List A It's in List B It's in neither list Formula: =IF(ISNUMBER(MATCH(D4,A4:A7,0)),B4,IF(ISNUMBER(MATCH(D4,A9:A12,0)),B9,"No matches"))
The IF function takes 3 arguments: Logic Test, Value if True, Value if False I think you are wanting to see if D4 is in either of two lists. We can check that with a couple of IF functions, as the 3 possible outputs are: It's in List A It's in List B It's in neither list Formula: =IF(ISNUMBER(MATCH(D4,A4:A7,0)),B4,IF(ISNUMBER(MATCH(D4,A9:A12,0)),B9,"No matches"))
B brianaclark1967 Member Apr 29, 2015 #3 Hi Luke, That worked great. Thank you so much, I really appreciate it. Best regards Brian