I've been able to create a CSE array formula that allows me to add up individual values listed to the right of specific words in a range.
Here is an example I'm making up off the top of my head:
Let's say I assign these categories numeric costs, say for a game. So, if I were to "purchase" certain types of things for a simulation:
There are three tiers, each one a subset of the lower tier, and each one assigned an absolute "cost". So
First tier costs 1 point
Second tier costs 2 points (plus the 1 point for the lower tier)
Third tier costs 3 points (plus the 3 points for the lower two tiers)
Costs are cumulative.
You'd only have to pay once for each uniquely named tier.
For example
Collectibles
A1: Treasure (tier 1) B1: Precious Metals (tier 2) C1: Gold (tier 3) [6 points]
A2: Treasure (tier 1) B2: Precious Metals (tier 2) C2: Silver (tier 3) [+ 3 points. Note 2nd tier is the same.)
A3: Treasure (tier 1) B3: Art (tier 2) C3: Tapestry (Tier 3) [+ 5 more points. Note that 2nd tier is different, increasing cost)
Total Point Cost: 14
I've created a formula that searches for each unique instance of the word in the 1st tier, and then adds up the point value of the 2nd and 3rd tiers along the same row. The user may enter whatever word they'd like for each tier, leading to a lot of random possibilities and combinations.
My formula works right now...except for one critical flaw. I can't figure out how to get it to EXCLUDE the second instance of any unique word at any of the three tiers. In other words, my sheet would calculate the above as 18. The named cells are not predetermined. But allowing the user to enter any word desired (it's for a game), means I've reached the limits of my ability to design this sheet.
Here's an example of the formula that only accounts for the unique name in the 1st tier. Imagine I'd add the cost of each tier to columns D,E, and F:
{=SUM(IF(A1:A3="Treasure",D1:D3+E1:E3+F1:F3))}
Now how on earth do I exclude the second or subsequent instances of the 2nd and 3rd tiers from the formula without going into VBA? Am I going to run into an endless loop of if-then?
Bookmarks