If Statements

kcdill

Board Regular
Joined
Mar 13, 2002
Messages
106
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
Joined
Apr 5, 2002
Messages
55
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.
:biggrin:
PAul
 

Zack Barresse

MrExcel MVP
Joined
Dec 9, 2003
Messages
10,881
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web
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.
 
Master Excel Bundle

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.

Forum statistics

Threads
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.
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
Top