1

I have to use the if-statement on column A from cells A2 to A5 to get the Headers data (B2 to G5) if-statement is TRUE. Data under the header will display in A2 if any cells under the heading from B2 to G2 are TRUE. Data under the header will display in A3 if any cells under the heading from B3 to G3 are TRUE. Data under the header will display in A4 if any cells under the heading from B4 to G4 are TRUE. Data under the header will display in A5 if any cells under the heading from B5 to G5 are TRUE.

I tried many ways but it didn't work.

=if(B2=TRUE, "Apple")+if(C2=TRUE, "Banana")+if(D2=TRUE, "Mango")+if(E2=TRUE, "Papaya")+if(B2=TRUE, "SugarCan"))

enter image description here

Here is the link of my sheet

1
  • This can be solved with a single formula that will return all results for all rows in Col A without dragging anything down. Please share a link to a spreadsheet that contains realistic data across the top row (e.g., if the Row-1 labels may have spaces, include some labels with spaces). I'd also want to be sure you were using true Boolean value TRUE and not a string value of TRUE. I'll try to check back to see if you've shared a link to a spreadsheet; but it's best to reply via comment to be sure I see it.
    – Erik Tyler
    Aug 19 at 9:24

1 Answer 1

1

Welcome!

You don't need an IF(), use the FILTER() function to select the headings you want, combine the selected words with the TEXTJOIN() function (use CHAR(10) to put each word on a new line), and wrap it all with the IFERROR() function in case there is no TRUE cell in the row

=IFERROR(TEXTJOIN(CHAR(10),1,FILTER($B$1:$G$1,B3:G3)),"Not found")

Example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.