MULTIPLE NESTING WITHIN EXCEL

G

George

I'm fairly comfortable working within Excel; however, I just know there must
be a work-around for multiple nesting requirements that I probably simply
just do not know of.
Specifically, I am looking for either the correct argument/formula or
"trick" to be able to complete an entry such as the following:

=IF(B18=136,"97",IF(B18=816,"97",IF(B18=160,"97",IF(B18=817,"97",IF(B18=138,"1",IF(B18=6848,"1",IF(B18=8527,"1",IF(B18=8954,"447",IF(B18=1773,"447",IF(B18=163,"447",IF(B18=1772,"447",IF(B18=155,"448",""))))))))))))
I would appreciate any time you are able to spend with this request.
 
D

David Biddulph

You'd be better using the VLOOKUP function.
Note also that your formula produced text strings as outputs. If you want
numbers, ditch the quote marks.
 
T

Tom Hutchins

David's suggestion of using Vlookup is very good. To make your formula work
using the IF function, you can group the conditions that produce the same
result using the OR function, like this:

=IF(OR(B18=136,B18=816,B18=160,B18=817),"97",IF(OR(B18=138,B18=6848,B18=8527),"1",IF(OR(B18=8954,B18=1773,B18=163,B18=1772),"447",IF(B18=155,"448",""))))

Hope this helps,

Hutch
 
S

Sandy Mann

Try:

=IF(OR(B18={136,160,816,817}),97,IF(OR(B18={138,6848,8527}),1,IF(OR(B18={8954,1771,162,1771}),447,IF(B18=155,448,""))))

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

[email protected]
Replace @mailinator.com with @tiscali.co.uk
 
Top