Need more than seven arguments in if

Last Edited By Krjb Donovan
Last Updated: Mar 05, 2014 09:49 PM GMT

Question

I am trying to create a spreadsheet with a cell having an "IF" formula with more than seven arguments-using2003-can't do-I know I cannot be the only person that needs something like this but I cannot figure out how get it done. The key/argument looks something like: IF(B19=36,"2880",IF(B19=32,"2560",IF(B19=28,"2080",(B19=24,"1920",IF(B19=20,"1600",IF(B19=16,"1280",IF(B19=12,"960",IF(B19=8,"640",IF(B19=4,"320",IF(B19=0,"0",IF(B19=E,"1600",IF(B19=C,"Level"))))))))))))


Answer

=CHOOSE(MATCH(B19,{36,32,28,24,20,16,12,8,4,0,"E","C"},0),"2880","2560","2080","1920","1600","1280","960","642","320","0","1600","level")

In this formula, numbers like "2880" are in quotes, because based on the formula in your question, I assumed you wanted the result to be anstring. If you want the result to be a number, then you'd replace

"2800","2560","2080"...

with

2800,2560,2080...

Advertisement

©2021 eLuminary LLC. All rights reserved.