I want 2 add some long values with "IF Statement" because I have 100 names of Branched and want to add with Code numbers of Branches e.g. =IF(A7=2,"Main Branch Karachi",IF(A7=3,"NBP Airport Branch",IF(A7=7,"NBP Custom House Branch",IF(A7=9,"NBP DHS Branch",IF(A7=10,"NBP Denso Hall Branch", IF(A7=12,"NBP Fish Harbour Branch", IF(A7=18,"NBP Aimai House Branch", IF(A7=27,"NBP M.A.Jinnah Road Branch", IF(A7=28,"NBP Malir Cantt. Branch", IF(A7=32,"NBP PAF Masroor Branch", IF(A7=42,"NBP Nazimabad Branch", IF(A7=44,"NBP Nicol Road Branch", IF(A7=48,"NBP PECHS Branch", IF(A7=49,"NBP PIB Colony Branch", IF(A7=50,"NBP PIDC House Branch", IF(A7=55,"NBP Saddar Branch", IF(A7=64,"NBP SITE Branch", IF(A7=71,"NBP Karachi University Branch","Error")))))))))

But error of "nested formla in this file" occurs.

What to do?

Let's assume that you are talking about Excel. You can only have 7 or less nested IFs in Excel. If you need more choices then you need to write a VBA macro (see this article) or else use the LOOKUP function in conjunction with a Table.

If you are not talking about Excel then it would help to specify the program you are using.

Maybe use a lookup.

Thanx Bro. But it works in Numberic Value not in Text Values.

Set up an array, such as: ...A.......B.......C.......D

9:...1.....one....._.....=LOOKUP(C9,A9:B11)

10:...2....two

11:...3....three

Ask Your Question

Weekly Poll

Would you ride in a self-driving car from Tesla?

Discuss in The Lounge

Poll History