If Statements

kcdill

Board Regular
Question 1. How can I make this thing shorter?

=IF((G106*H106)>900,"Special",IF(VesselID,SETV(IF(D106=20,VLOOKUP((G106*H106),CoverRingFlangeThickness,2,TRUE),IF(D106=24,VLOOKUP((G106*H106),CoverRingFlangeThickness,4,TRUE),IF(D106=30,VLOOKUP((G106*H106),CoverRingFlangeThickness,6,TRUE),IF(D106=36,VLOOKUP((G106*H106),CoverRingFlangeThickness,8,TRUE),"Size?")))))+Summary!\$D\$9,GETV()))

Question 2. Can I add another If Statement for an 18” flange? such as IF(D106=18,VLOOKUP((G106*H106),CoverRingFlangeThickness,2,TRUE). I tried the formula below and get error messages. Do I have too many Ifs?

=IF((G106*H106)>900,"Special",IF(VesselID,SETV(IF(D106=18,VLOOKUP((G106*H106),CoverRingFlangeThickness,2,TRUE),IF(D106=20,VLOOKUP((G106*H106),CoverRingFlangeThickness,4,TRUE),IF(D106=24,VLOOKUP((G106*H106),CoverRingFlangeThickness,6,TRUE),IF(D106=30,VLOOKUP((G106*H106),CoverRingFlangeThickness,8,TRUE),IF(D106=36,VLOOKUP((G106*H106),CoverRingFlangeThickness,10,TRUE),"Size?"))))))+Summary!\$D\$9,GETV()))

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

polly

Board Regular
Well as to the second Question...you can only nest 7 IF() in a formula. You may try adding OR(), AND() to the IF() statements.
As to the first Question I think if you post some more info , like what the Data looks like, the formula could probably be shortened and changed.

PAul

Zack Barresse

MrExcel MVP
i'm sure there's a formula solution to your quandry here. just post a little more info on what's in D106, G106 & H106; what are your requirements, and the desired outcome. maybe w/ HTML maker.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,168,036
Messages
5,856,957
Members
431,841
Latest member
jaybeem

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.

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

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