Help with IF function scanning a range of cells

frannyM

New Member
Joined
Jan 8, 2021
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
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!

ExcelPhoto1.png
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try
Excel Formula:
=TEXTJOIN(", ",1,IF(D2:N2="Yes",D$1:N$1,""))
Which must be array confirmed with Ctrl Shift Enter.
 
Upvote 0
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
    ExcelPhoto2.png
    31.5 KB · Views: 53
  • ExcelPhoto2.png
    ExcelPhoto2.png
    31.5 KB · Views: 57
  • ExcelPhoto3.png
    ExcelPhoto3.png
    41 KB · Views: 51
  • ExcelPhoto4.png
    ExcelPhoto4.png
    52.4 KB · Views: 61
Upvote 0
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,""))
 
Upvote 0
Solution
Awesome that worked! Thank you for your help much appreciated!
 
Upvote 0
@jasonb75 Hi, I'm trying to apply this to a project. I have the same sheet structure as this example. However, It is returning zeros as franny originally encountered. I'm using this formula as seen in the comments, =TEXTJOIN(", ",1,IF(D3:AF3="Yes",D$1:AF$1,"")). Am I missing something?
 
Upvote 0
Hi & welcome to MrExcel.
Do you have anything in row 1 of the sheet?
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top