witchcraftz
New Member
- Joined
- Jan 17, 2008
- Messages
- 39
I have a spreadsheet in which I need to do something unusual.
The setup:
Each cell will contain a list of keywords. Each keyword is worth a specific value (1-4). A cell may contain any number of keywords in any order, however each keyword only repeats once.
Data sheet
Results sheet
Part1 :Getting a list that transposes the words in the cell to a list of associated values.
I've done this 2 ways but I feel both are ugly and nonuser friendly, would be great if someone had a better/simpler way to do this.
In the results sheet I expect the value list to return 1, 2, 4 (in any order is fine)
These work but are ugly:
Option1: =TEXTJOIN(", ", TRUE, IF(COUNTIF(results!A2, "*"&data!A2:A5&"*"), data!B2:B5, ""))
Option2: =IF(ISNUMBER(FIND("Bob",results!A2,1))=TRUE,"1, ","")&IF(ISNUMBER(FIND("Mary",results!A2,1))=TRUE,"3, ","")&IF(ISNUMBER(FIND("Phil",results!A2,1))=TRUE,"2, ","")&IF(ISNUMBER(FIND("Brown",results!A2,1))=TRUE,"4, ","")
Part2 : Sum up the associated values for every word in the cell.
I've looked at sumifs and sumproduct but I couldn't get this to work!
The uploaded image shows what the result should be
The setup:
Each cell will contain a list of keywords. Each keyword is worth a specific value (1-4). A cell may contain any number of keywords in any order, however each keyword only repeats once.
Data sheet
source | value |
Bob | 1 |
Mary | 3 |
Phil | 2 |
Brown | 4 |
Results sheet
input | value list | value sum |
Phil,Bob,Brown | 1, 2, 4 | 7 |
Part1 :Getting a list that transposes the words in the cell to a list of associated values.
I've done this 2 ways but I feel both are ugly and nonuser friendly, would be great if someone had a better/simpler way to do this.
In the results sheet I expect the value list to return 1, 2, 4 (in any order is fine)
These work but are ugly:
Option1: =TEXTJOIN(", ", TRUE, IF(COUNTIF(results!A2, "*"&data!A2:A5&"*"), data!B2:B5, ""))
Option2: =IF(ISNUMBER(FIND("Bob",results!A2,1))=TRUE,"1, ","")&IF(ISNUMBER(FIND("Mary",results!A2,1))=TRUE,"3, ","")&IF(ISNUMBER(FIND("Phil",results!A2,1))=TRUE,"2, ","")&IF(ISNUMBER(FIND("Brown",results!A2,1))=TRUE,"4, ","")
Part2 : Sum up the associated values for every word in the cell.
I've looked at sumifs and sumproduct but I couldn't get this to work!

The uploaded image shows what the result should be
Attachments
Last edited: