Forum Discussion
Scoring list
It is always a lot easier to help people if, in addition to the description of the task--which you've provided--they post a copy of the spreadsheet. Unless there's something confidential in yours, which seems unlikely, could you please place a copy of the actual Excel spreadsheet on OneDrive or GoogleDrive and paste a link here that grants edit access to it.
That said, instead of nesting multiple levels of IF functions, you can profitably make use of the IFS function for testing multiple conditions. That enables a shorter formula, more readable, more understandable, and easier to maintain. Here's a description of it.
- FarahSlotegraaf872Nov 03, 2023Copper ContributorHi Mathetes,
Thank you for mentioning the IFS function document! I will try it out.
Here is the GoogleDrive link to my document. I have not applied any coding of the AFS document you provided. This is the original document:
https://docs.google.com/spreadsheets/d/11oSRFJnjLVMi5jd-NkgKXuJXga5vZ_0y/edit?usp=sharing&ouid=103858001730657634068&rtpof=true&sd=true
I marked the cells yellow that hold the coding for counting the points. I also made notes describing my wishes for this document in cell A45.
Kind regards,
Farah- mathetesNov 03, 2023Silver Contributor
I'll try to look at this further later on this weekend. But just now, having looked at it, having seen the full formula that you've created, I have these suggestions.
- If you ever find yourself needing to write a formula with multiple nested IFs (not IFS..that's different, and I don't think IFS is what you need here), especially if that formula extends as long as yours does, don't do it. You've managed to make this one work without syntax errors, and that's commendable, but it's not a formula that's easily read and understood. Which means that next year, or even next month, if a change were to be required, you would have a hard time going back and doing the maintenance. And somebody else would not even be able to do it. (Seriously, the books on Excel all recommend against such long IF formulas for exactly those reasons.)
- So that leaves us needing to find a different way to accomplish the objective. And there are several options there. It looks to me as if your first 15 criteria follow the same pattern, so I'd suggest starting with a table that could be accessed via VLOOKUP, or INDEX and MATCH:
- Maybe most important, though, would be to not even try to do the scoring and the totaling all in a single formula as you're doing it. Use what we call "helper columns," maybe hidden but maybe not, depending on who sees it, whether it matters. (a) Score each one on its own in the helper column. (b) Then add the results.
- And some combination of that for the highlighted items in yellow....but the basic idea would be to score them independently and then incorporate the results into a single consolidated result as desired.
It may be very intellectually satisfying to write a single formula that accomplishes it all, and there are times when long formulas are unavoidable; I don't think this is one of those latter occasions.