If column shows yes, show text from cell above

thedeadzeds

Active Member
Joined
Aug 16, 2011
Messages
442
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

I have 3 columns as per below. If column A (Duplicate) shows yes I need column C (Result) to show the result from cell above in column B (Name). If not just show the text from column B. So the result column should look as per below. Can someone please help? Thanks

DuplicateNameResult
DaveDave
JimJim
YesSteveSteve
YesPaulSteve
JimJim
CarolCarol
ChrisChris
BobBob
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Your example does NOT seem to follow this condition:
If column A (Duplicate) shows yes I need column C (Result) to show the result from cell above in column B (Name). If not just show the text from column B
That would suggest that in the first line with the "Yes", it should be pulling "Jim", not "Steve".

Do you perhaps mean that it should only pull from the Name above on the second "Yes" line (and not the first)?
If that is the case, will the "Yes" entries always show up in pairs, or more (at least two in a row)?

If those assumptions are correct, place this formula in C2 and copy down for all rows:
Excel Formula:
=IF(AND(A1="Yes",A2="Yes"),B1,B2)
 
Upvote 0
Sorry, yes this is =correct:
Do you perhaps mean that it should only pull from the Name above on the second "Yes" line (and not the first)?
If that is the case, will the "Yes" entries always show up in pairs, or more (at least two in a row)?

and the Yes entries will always show up in pairs or more but they will always be listed together. For example:

DuplicateNameResult
DaveDave
JimJim
YesSteveSteve
YesPaulSteve
JimJim
CarolCarol
ChrisChris
BobBob
DaveDave
JimJim
YesSteveSteve
YesPaulSteve
YesJimSteve
YesCarolSteve
ChrisChris
BobBob
 
Upvote 0
OK, did you try my solution that I posted in the previous post?
I think that will do what you want.
 
Upvote 0
That does work but only for 2 duplicates. Any more and it doesn't
Kind of a brute force method (I am sure that there are more elegant solutions), but this should work.

In you first cell (C2), just enter:
Excel Formula:
=B2

Then, in cell C3, enter:
Excel Formula:
=IF(AND(A1="Yes",A2="Yes",A3="Yes"),C2,IF(AND(A2="Yes",A3="Yes"),B2,B3))
and copy down for all rows.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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