View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
[email protected] viasarpimilano@gmail.com is offline
external usenet poster
 
Posts: 4
Default nested IF without repeating the condition to be tested

let's make it more clear.

User has a worksheet with a database with many records/rows.
For each row, there is a cell with a value with can be one of these four options: A, AA, AAA, AAAA.
According to which option is selected for each record, a different SUM has to be performed.
Now on a different worksheet, I need a formula which performs the proper SUM, according to what is written in the database. So the "nested if" came to my mind.
IF('somethingLong'=A;sumTHIS;if('somethingLong'=AA ;sumThat;if('somethingLong'=AAA;sumThose;sumthese) ))

I am looking for a way to avoid writing 'somethingLong' 3 times.

hope is clearer
thanks a lot