Help with IF function scanning a range of cells

frannyM

New Member
Hello,

I need help with an IF function. I may be using the wrong function, but basically, I want the logical test to scan a range of cells to see if they have "Yes". If the cell has yes, I want to add the column title into the description.

Example: Accessory 1 is compatible with System 1 and System 3. In the description cell, I want to use the formula to scan the row for "Yes" and return System 1, System 3.

When I use this formula =IF(D3:N3="Yes",D2:N2,"") I get a #VALUE! error.

When I use the formula to reference two specific cells, =IF(D7= "Yes",D2,"") it works but then I would have to use multiple formulas in one cell?

I attached a screenshot showing what I am working with, I can clarify further I didn't explain this thoroughly enough.

Thank you!

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

jasonb75

Well-known Member
Try
Excel Formula:
``=TEXTJOIN(", ",1,IF(D2:N2="Yes",D\$1:N\$1,""))``
Which must be array confirmed with Ctrl Shift Enter.

frannyM

New Member
Try
Excel Formula:
``=TEXTJOIN(", ",1,IF(D2:N2="Yes",D\$1:N\$1,""))``
Which must be array confirmed with Ctrl Shift Enter.

Thanks for the quick response! I tried using that formula it seems to only output 0s. I attached a couple of photos that might be helpful.

Attachments

• ExcelPhoto2.png
31.5 KB · Views: 3
• ExcelPhoto2.png
31.5 KB · Views: 4
• ExcelPhoto3.png
41 KB · Views: 3
• ExcelPhoto4.png
52.4 KB · Views: 4

jasonb75

Well-known Member
Sorry, my fault. I missed the empty row at the top of the sheet. It should be
Excel Formula:
``=TEXTJOIN(", ",1,IF(D3:N3="Yes",D\$2:N\$2,""))``

frannyM

New Member
Awesome that worked! Thank you for your help much appreciated!

Replies
5
Views
247
Replies
1
Views
448
Replies
5
Views
54
Replies
0
Views
96
Replies
3
Views
119

Forum statistics

1,126,931
Messages
5,621,663
Members
415,849
Latest member
PhoenixRising2015

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back