Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
MS Excel - IF Statement - is there a limit?
Here is an odd question:
Here is the formula I am typing below
=IF(B9=$B$101,$C$101),
IF(B9=$B$102,$C$102), etc.
i am typing all the way to $C$108
Everything works fine. BUT: When I try to add in the next sequence: IF(B9=$B$109,$C$109, I receive an error msg:
"The formula you typed contains an error."
there is no error!
The data the this stuff is referencing to is correct.
I am wondering if perhaps here is a limit to the number of IF/THEN entries you can enter?
If so, is there another way to get around this (Like VBS script)?
I need to make it to IF(B9=$B$124,$C$124) so another 15 or so entries.
Please help!!!!
Thanks for your responses--I was thinking that VBS is needed--but do you know how to translate what I have now into VBS?
5 Answers
- aladouLv 51 decade agoFavorite Answer
Yes, you've reached the limit on nested IFs.
You could use VLOOKUP in this case:
=VLOOKUP(B9, $B$101:$C$124, 2, false)
This will look for B9 in B101:B124, and the first time it finds it, it will return what's in C on the same row.
Good luck.
_______
EDIT: By the way, if there is a chance B9 won't be in B101:B124, you may want to account for that:
=IF(ISERROR(VLOOKUP(B9, $B$101:$C$124, 2, false)), "not found", VLOOKUP(B9, $B$101:$C$124, 2, false))
If Vlookup returns an error (i.e. it didn't find it), this will display a message (e.g "not found"), otherwise it will display the result from column C.
.
- 6 years ago
This Site Might Help You.
RE:
MS Excel - IF Statement - is there a limit?
Here is an odd question:
Here is the formula I am typing below
=IF(B9=$B$101,$C$101),
IF(B9=$B$102,$C$102), etc.
i am typing all the way to $C$108
Everything works fine. BUT: When I try to add in the next sequence: IF(B9=$B$109,$C$109, I receive an error msg:
"The formula...
Source(s): ms excel statement limit: https://shortly.im/FDV5F - Barkley HoundLv 71 decade ago
There is probably a limit to the length of an entry. OpenOffice Calc has the option to define names where they can actually be formulas. See if Excel has the same feature. You can use the names as functions in a formula. For example if the name xxx was defined as =if(a=b;x;y) putting xxx in a function would have the same effect as inserted the complete formula. There may still be the same size limit if the expansion work area has the limit.
- How do you think about the answers? You can sign in to vote the answer.
- Anonymous1 decade ago
I believe you can nest 8 If loops in one cell. You would either have to reference another cell with more IF statements or go to VBA for excel and write some code.