Reputation: 1
I am making an assessment spreadsheet in Excel, and I want to return two sentences based on whether on not certain checkboxes are ticked.
For example, for spelling, we might be learning the suffixes '-ly' '-ed' and '-ing'. I want to return a result in one cell "Johnny has mastered the following suffixes: -ly, -ed," if those two checkboxes were ticked in Johnny's column.
In another cell, I want to return "Johnny is still working on the following suffixes: -ing" as that was not ticked in Johnny's column. I have worked out how to do the former, but need help with the latter. Here was my solution for the first, where C1 = Johnny's name, B column = the checkboxes, and A column = the names of the suffixes:
=TEXTJOIN(" ", TRUE, C1, "mastered the following suffixes:", IF(OR(NOT(B2), B2=""), "", A2), IF(OR(NOT(B3), B3=""), "", A3), IF(OR(NOT(B4), B4=""), "", A4),)
However, I can't work out how to give the negative sentence, based on the checkboxes that aren't ticked. Any help is appreciated!
I'm still learning excel functions and so I played around with it for a bit, but with no luck.
Upvotes: 0
Views: 43
Reputation: 21
You can replace your formula with:
=TEXTJOIN(" ",TRUE,C1,"mastered the following suffixes:",FILTER(A2:A4,B2:B4=1))
And use the additional formula for checkboxes that aren't ticked:
=TEXTJOIN(" ",TRUE,C1,"is still working on the following suffixes:",FILTER(A2:A4,B2:B4=0))
The number of elements in the first and second arrays in the filter function should be the same.
Upvotes: 0