Formula help

wildbio

New Member
Joined
Sep 14, 2011
Messages
6
I need a formula that will return a value in a different column but the same row. ie. if any cell in column A contains the text "YES", return the contents (text) in the corresponding row of column C. All rows of column A will be filled and only some of column C.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Does this formula do what you want?

=IF(COUNTIF(A1,"*yes*"),C1,"")
 
Last edited:
Upvote 0
Thanks but the formula will be in one cell in a different worksheet. I need it to scan the columns like the countif function does.
 
Upvote 0
Thanks but the formula will be in one cell in a different worksheet. I need it to scan the columns like the countif function does.
Then prefix the cell references with the worksheets they are on. For my formula, something like this where you would replace my 'Sheet 1' reference with your actual sheet name...

=IF(COUNTIF('Sheet 1'!A1,"*yes*"),'Sheet 1'!C1,"")
 
Upvote 0
Then prefix the cell references with the worksheets they are on. For my formula, something like this where you would replace my 'Sheet 1' reference with your actual sheet name...

=IF(COUNTIF('Sheet 1'!A1,"*yes*"),'Sheet 1'!C1,"")
Thanks but again, that only looks in one cell, I need it to check all cells in the column.
 
Upvote 0
Thanks but again, that only looks in one cell, I need it to check all cells in the column.
None of what you actually wanted has been deducible until your message at Message #6. Give this formula a try...

=INDEX('Sheet 1'!C:C,MATCH("*yes*",'Sheet 1'!A:A,0))

The above formula will find cells with "yes" in them even if the "yes" is embedded in other text. If the "yes" you are looking for is to be the only text in the cell, then remove both asterisks so that you won't get an accidental match with an early cell contain text that includes an embedded "yes" in it.
 
Upvote 0
None of what you actually wanted has been deducible until your message at Message #6. Give this formula a try...

=INDEX('Sheet 1'!C:C,MATCH("*yes*",'Sheet 1'!A:A,0))

The above formula will find cells with "yes" in them even if the "yes" is embedded in other text. If the "yes" you are looking for is to be the only text in the cell, then remove both asterisks so that you won't get an accidental match with an early cell contain text that includes an embedded "yes" in it.
That's not working. It gives me an #N/A. Let me try to explain what I need more clearly. I need a formula to scan two columns that looks something like this
No X
Yes X
Yes
No X
Yes X
I need it to return the number 2 because there are two Yes's in the first column that have corresponding Xs in the second column.
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,948
Latest member
UsmanAli786

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