Easier way than multiple IF statements?

SamPer

New Member
Joined
Aug 27, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have spreadsheet where I am providing calculations based on 3 variables where the user can select, via drop down list, between a few options. Variables 1 and 2 have its own % assigned to it, and Var3 simply indicates if the calculation should be considered.

For Instance =

Starting Value = 10
Starting Phase = 1

Var1 = Summer (10%) OR Winter (100%)
Var2 = Home (50%) OR Office (100%)
Var3 = Phase # (Any number greater than 1 through 10)

User Selection:
Var1 = Summer
Var2 = Office
Var3 = 1

Result should be: (10*.1*1) =1

However, if the Starting Phase were to change to anything other than 1 (Var3), the Result should be 0.

Is there a faster way than multiple embedded IF statements to obtain a clean result?

TIA!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try:

=Var1*Var2*Var3*(StartingPhase=Var3)

Where each of Var1, Var2, Var3, and StartingPhase are cell references.
 
Upvote 0
Thanks for the reply. Unfortunately its a little more involved than this. I tried to simplify the problem but I don't think I conveyed my actual issue. There are a series of calculations behind the "5,6,7,8" values, but in short, this is what I mean:


1630536766589.png

I was able to get all combinations but Var1 = Office, Var2 - Winter to work. Its still giving me a "7" Any ideas?

Thanks!
 
Upvote 0
I'm not able to edit my response, but I was able to figure it out.

=IF($I$4=$N28,IF($I$2="HOME",IF($I$3="SUMMER",T28,U28),IF($I$2="OFFICE",IF($I$3="SUMMER",V28,W28))),"")
 
Upvote 0
There are a lot of ways to do this, depending on your sheet:

Book4 (version 1).xlsb
ABCDEFG
1
2Var1OFFICE
3Var2Winter
4Ph2
5
6
7HomeOfficeRESULT
8PHSUMMERWINTERSUMMERWINTER
9256788
108
118
Sheet9
Cell Formulas
RangeFormula
G9G9=INDEX(C9:F9,(D2="OFFICE")*2+(D3="WINTER")+1)*(B9=D4)
G10G10=IF(B9=D4,IF(D2="Home",IF(D3="Summer",C9,D9),IF(D3="Summer",E9,F9)),"")
G11G11=IF(B9=D4,HLOOKUP(D3,OFFSET(C8,0,MATCH(D2,C7:E7,0)-1,2,2),2,0),"")


None of these have error handling, which may be ok if you select the values from a drop-down.
 
Upvote 0
Solution
There are a lot of ways to do this, depending on your sheet:

Book4 (version 1).xlsb
ABCDEFG
1
2Var1OFFICE
3Var2Winter
4Ph2
5
6
7HomeOfficeRESULT
8PHSUMMERWINTERSUMMERWINTER
9256788
108
118
Sheet9
Cell Formulas
RangeFormula
G9G9=INDEX(C9:F9,(D2="OFFICE")*2+(D3="WINTER")+1)*(B9=D4)
G10G10=IF(B9=D4,IF(D2="Home",IF(D3="Summer",C9,D9),IF(D3="Summer",E9,F9)),"")
G11G11=IF(B9=D4,HLOOKUP(D3,OFFSET(C8,0,MATCH(D2,C7:E7,0)-1,2,2),2,0),"")


None of these have error handling, which may be ok if you select the values from a drop-down.
Thank you! Thats so helpful and looks much cleaner.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,748
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top