Alternative to nested IFs for > 8 arguments

glad_ir

Board Regular
Joined
Nov 22, 2020
Messages
143
Office Version
  1. 2010
Platform
  1. Windows
Hi,

Can anybody help me with this one please?

I am using the formula below in a sheet to avoid duplicating entries if they match earlier rows and it's working well but I need to extend beyond 8 nested IFs

Excel Formula:
=IF($G19=" ","",IF($G19="","",IF($G19=$G18,"see above",IF($G19=$G17,"see above",IF($G19=$G16,"see above",IF($G19=$G15,"see above",IF($G19=G14,"see above",IF(G19=$G13,"see above",IF(G19=$G12,"see above",VLOOKUP($G19,$S$57:$U$68,2,0))))))))))

Below is the next formula I'd like to be able to write.....but too many IFs

Excel Formula:
=IF($G19=" ","",IF($G19="","",IF($G19=$G18,"see above",IF($G19=$G17,"see above",IF($G19=$G16,"see above",IF($G19=$G15,"see above",IF($G19=G14,"see above",IF($G19=$G13,"see above",IF($G19=$G12,"see above",IF($G19=$G11,"see above", VLOOKUP($G19,$S$57:$U$68,2,0)))))))))))

Is there a way to achieve the above?

Any help is much appreciated.

thank you,
Iain
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
first observation
Where you have the same TRUE result
Ie = "see above",

IF($G19=$G17,"see above",IF($G19=$G16,"see above",IF($G19=$G15,"see above",IF($G19=G14,"see above",IF($G19=$G13,"see above",IF($G19=$G12,"see above",IF($G19=$G11,
could be replaced with a countif

=countif($G11:$G18,$G19)>0 , “see Above”

these
=IF($G19=" ","",IF($G19="","",
same result ""
then
OR( $G19=" ", $G19 = "") ,

so
IF( OR( $G19=" ", $G19 = "") , "" , IF ( countif($G11:$G18,$G19)>0 , “see Above” , VLOOKUP($G19,$S$57:$U$68,2,0) ))

=IF( OR( $G19=" ", $G19 = ""),"", IF(COUNTIF($G11:$G18,$G19)>0, “see Above”, VLOOKUP($G19,$S$57:$U$68,2,0) ))
Does that do the same

will vlookup return an error at all ?
maybe
=IF( OR( $G19=" ", $G19 = ""),"", IF(COUNTIF($G11:$G18,$G19)>0, “see Above”, IFERROR(VLOOKUP($G19,$S$57:$U$68,2,0),"") ))
 
Upvote 0
How about
Excel Formula:
=IF(TRIM($G19)="","",IF(COUNTIFS($G11:$G18,$G19)>0,"see above", VLOOKUP($G19,$S$57:$U$68,2,0)))
 
Upvote 0
Solution
first observation
Where you have the same TRUE result
Ie = "see above",

IF($G19=$G17,"see above",IF($G19=$G16,"see above",IF($G19=$G15,"see above",IF($G19=G14,"see above",IF($G19=$G13,"see above",IF($G19=$G12,"see above",IF($G19=$G11,
could be replaced with a countif

=countif($G11:$G18,$G19)>0 , “see Above”

these
=IF($G19=" ","",IF($G19="","",
same result ""
then
OR( $G19=" ", $G19 = "") ,

so
IF( OR( $G19=" ", $G19 = "") , "" , IF ( countif($G11:$G18,$G19)>0 , “see Above” , VLOOKUP($G19,$S$57:$U$68,2,0) ))

=IF( OR( $G19=" ", $G19 = ""),"", IF(COUNTIF($G11:$G18,$G19)>0, “see Above”, VLOOKUP($G19,$S$57:$U$68,2,0) ))
Does that do the same

will vlookup return an error at all ?
maybe
=IF( OR( $G19=" ", $G19 = ""),"", IF(COUNTIF($G11:$G18,$G19)>0, “see Above”, IFERROR(VLOOKUP($G19,$S$57:$U$68,2,0),"") ))
Hi Etaf, thank you for replying.

I get a #NAME error with the formula above. Fluff's formula works so I am all set.

Thank you again for replying.

Best regards,
Iain
 
Upvote 0
How about
Excel Formula:
=IF(TRIM($G19)="","",IF(COUNTIFS($G11:$G18,$G19)>0,"see above", VLOOKUP($G19,$S$57:$U$68,2,0)))
Thank you for this. It works perfectly :)

Best,
Iain
 
Upvote 0
I get a #NAME error with the formula above. Fluff's formula works so I am all set.
glad its working with @Fluff formula

not sure why yo uget a name error
=IF(OR( $G19=" ", $G19 = ""),"", IF(COUNTIF($G11:$G18,$G19)>0, "see Above", IFERROR(VLOOKUP($G19,$S$57:$U$68,2,0),"") ))
works OK in my Spreadsheet

But sorry about that
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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