ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   €śUse of more then 7 nested if statement€ť (https://www.excelbanter.com/excel-worksheet-functions/9094-%E2%80%9Cuse-more-then-7-nested-if-statement%E2%80%9D.html)

Faisal Yameen

€śUse of more then 7 nested if statement€ť
 
I used if statement in the form of
=IF(B37=B2,C37,IF(B38=B2,C38,IF(B39=B2,C39,IF(B40= B2,C40,IF(B41=B2,C41,
IF(B42=B2,C42,IF(B43=B2,C43,IF(B44=B2,C44,"Un Known"))))))))
(It means if cell B2 is equal to B37 then print C37 and if cell B2 is equal
to B38 then print C38 and respectively others)
(I used this formula in cell C2)
Here I used only 7 nested if statement. But now I want to use more then it
nearly 500 nested if statement.
Please help me and guide me about this problem
Thanks.


Bernie Deitrick

Faisal,

In C2, use the formula:

=VLOOKUP(B2,B37:C2000,2,FALSE)

HTH,
Bernie
MS Excel MVP

"Faisal Yameen" wrote in message
...
I used if statement in the form of
=IF(B37=B2,C37,IF(B38=B2,C38,IF(B39=B2,C39,IF(B40= B2,C40,IF(B41=B2,C41,
IF(B42=B2,C42,IF(B43=B2,C43,IF(B44=B2,C44,"Un Known"))))))))
(It means if cell B2 is equal to B37 then print C37 and if cell B2 is

equal
to B38 then print C38 and respectively others)
(I used this formula in cell C2)
Here I used only 7 nested if statement. But now I want to use more then it
nearly 500 nested if statement.
Please help me and guide me about this problem
Thanks.




Bernie Deitrick

Faisal,

Sorry, forgot about the not found part:

=IF(ISERROR(VLOOKUP(B2,B37:C2000,2,FALSE)),
"UnKnown",VLOOKUP(B2,B37:C2000,2,FALSE))

All on one line....

HTH,
Bernie
MS Excel MVP

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Faisal,

In C2, use the formula:

=VLOOKUP(B2,B37:C2000,2,FALSE)

HTH,
Bernie
MS Excel MVP

"Faisal Yameen" wrote in message
...
I used if statement in the form of
=IF(B37=B2,C37,IF(B38=B2,C38,IF(B39=B2,C39,IF(B40= B2,C40,IF(B41=B2,C41,
IF(B42=B2,C42,IF(B43=B2,C43,IF(B44=B2,C44,"Un Known"))))))))
(It means if cell B2 is equal to B37 then print C37 and if cell B2 is

equal
to B38 then print C38 and respectively others)
(I used this formula in cell C2)
Here I used only 7 nested if statement. But now I want to use more then

it
nearly 500 nested if statement.
Please help me and guide me about this problem
Thanks.







All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com