Forum Discussion
264 nested IF statements -- alternative?
- Jun 06, 2025
OK. I've modified your data.xlsx to make, I trust, how to do this clear. Here's the basic Input and Output area
I usually follow a convention of using yellow background in any cell that calls for entry by the user, and have followed that convention here. Other than the "Raw Score" cell, I've also used Data Validation to ensure that only acceptable values are entered. In the two cases, there are only two choices of appropriate text. In the others, a whole number is required, within the acceptable range.
Then, in the gray areas, the calculations are done, in both cases using INDEX and MATCH. The tables for those retrievals are on a separate "Behind the Scenes" tab. It looks like this:
There are formulas in the column of four category identifiers. And a final formula in the gray background area, where the column heading is calculated, simply by concatenating the strings above. I do this in the simplest way, using the "&" symbol. It could be done other ways, but really not necessary here. I also should note that some folks would combine all these formulas into a single one; that's entirely possible, but for your sake in understanding all the steps, I've chosen to break it into separate steps.
I also did not take the trouble to verify all the outputs when changing the inputs on that primary screen. You should do that.
Let me know if you have questions.
Thank you for you explanation. I've spent some time learning about INDEX MATCH MATCH and have a better understanding of how that could be used for this. I'm now stuck on how to create a value for the MATCH (columns) part of the formula (what you have highlighted in yellow). I went ahead and changed my table to using your approach (single table with column headings for each demographic combination). Really appreciate your help and recommendations!
OK. I've modified your data.xlsx to make, I trust, how to do this clear. Here's the basic Input and Output area
I usually follow a convention of using yellow background in any cell that calls for entry by the user, and have followed that convention here. Other than the "Raw Score" cell, I've also used Data Validation to ensure that only acceptable values are entered. In the two cases, there are only two choices of appropriate text. In the others, a whole number is required, within the acceptable range.
Then, in the gray areas, the calculations are done, in both cases using INDEX and MATCH. The tables for those retrievals are on a separate "Behind the Scenes" tab. It looks like this:
There are formulas in the column of four category identifiers. And a final formula in the gray background area, where the column heading is calculated, simply by concatenating the strings above. I do this in the simplest way, using the "&" symbol. It could be done other ways, but really not necessary here. I also should note that some folks would combine all these formulas into a single one; that's entirely possible, but for your sake in understanding all the steps, I've chosen to break it into separate steps.
I also did not take the trouble to verify all the outputs when changing the inputs on that primary screen. You should do that.
Let me know if you have questions.
- getcracken801Jun 10, 2025Copper Contributor
Thank you so much for all of this! I went over all the of the formulas and I can clearly see how the INDEX MATCH formula works here. This is incredibly useful.
- mathetesJun 10, 2025Gold Contributor
You are most welcome. It was a good learning experience for me to. If that surprises you, it shouldn't. I strongly suspected from the start that a single table was possible, but I've never had to construct a process with so many intervening steps required to get to the desired bit of data--in this case, the "t-score"--after beginning with all those variables.
Part of the learning for you, I hope, is how a good design is one of the most important starting points; in particular, a well designed database. Just knowing how to do VLOOKUP formulas--as you were doing coming in--wasn't sufficient, even if it might have been possible to construct an elaborate way to individually name each table and reference each table with a LOOKUP buried in an IF or IFS or other shell.
Take the time to educate yourself on all of the different functions and capabilities of Excel...a resource like ExcelJet is highly recommended. In the old days, when printed manuals accompanied software, I used to read, and then re-read the Lotus 1-2-3 manuals every year, always discovering an easier way to do something, something I'd been doing that worked but was far less efficient, like having 264 tables and making them work, but not realizing that re-thinking, using a hitherto unknown function, would make it possible to get to the same end product far more effectively, reliably.
- getcracken801Jun 11, 2025Copper Contributor
Thanks for sharing that this was a learning experience for you too. I don't remember learning this kind of stuff in my college Excel class, though I'm not sure it would have stuck anyway since the fabricated data/scenarios weren't relevant to me, making it harder to grasp the value of different functions. The multiple steps did complicate it a bit. Even after understanding more about INDEX and MATCH, I still couldn't figure out the additional steps to make it all work. You've introduced me to a lot of different functions and how they can be used in combination. I will be sure to check out the ExcelJet resource.