How to make an Excel nested if, else, and statement - Stack Overflow
Nested IFs; A More Efficient Way?
What alternatives exist to complex nested If statements?
Nested IF, AND, OR
Videos
Hey fellow Redditors,
I am working on an Excel spreadsheet tracking state/country attendance for my work, and I am trying to build a formula that references a long list (~250 rows) of country names and their country code equivalent and automatically fills in the country code in column D based off of the country name typed out in column C. After some research and testing, I’ve discovered one way to do this as nesting IF statements. The formula I currently have started is: =IF(C94=H$1,I$1,IF(C94=H$2,I$2,IF(C94=H$3,I$3,IF(C94=H$4,I$4,IF(C94=H$5,I$5,IF(C94=H$6,I$6,IF(C94=H$7,I$7,…IF(C94=H$250,I$250)))))))) I’ve only typed out a few of these statements (IF(CX=H$X,I$X)), and after some concern about character limit in formulas, I am both tired and concerned that I will not be able to finish my formula this way as it stands. There has got to be a better way to do this, I just don’t have enough Excel experience to be able to figure out how I could effectively condense this formula (tried a couple things, like trying to reference the columns by H:H and I:I; didn’t work)
Your advice is much appreciated!
Hey r/excel!
Is it possible for excel to look to a cell, and make a determination based on the contents of that cell, without needing to have a series of nested if-statements?
For example:
Cell A2 contains the value: "DOG" Cell B2 calls a series of rules that are specific to "DOG", and calculates.
Because my list of calculation determinants (DOGs) is long, and the calculations they are associated with can vary widely, I would prefer not to use a difficult-to-audit complex 'if' statement. But I'm not sure what other avenues are open to me.
EDIT: To be clear, I need something that will call an active formula. I don't think I can accomplish that with a vlookup or index/match (but if it's possible please let me know!).
Help!
