Michael515

Board Regular
Joined
Jul 10, 2014
Messages
136
Looking at this image: View image: ex 4

I want to be able to in cell C2 have a function that looks at Cell B2 and if it says "Yes" look at Cell B1 and it it reads "No" return value A1.
For cell C3, what should happen is that it looks at B3 sees "Yes", then looks at cell B2 sees another "Yes" so it goes up until it sees "No" which is B1 and therefore cell C3 returns A1, thus cell C2 and C3 have the same returning value.

Thanks for any and all help!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
See if this helps:


Excel 2010
ABC
11No
22Yes1
33Yes1
44Yes1
55No5
66No6
77Yes6
88Yes6
99Yes6
1010No10
1111No11
1212No12
1313Yes12
Sheet1
Cell Formulas
RangeFormula
C2{=INDEX($A$1:$A$13,SMALL(IF($B$1:$B2<>"No","",ROW($B$1:$B2)),COUNTIF($B$1:$B2,"No")))}
Press CTRL+SHIFT+ENTER to enter array formulas.


Luke
 
Upvote 0
I was working off one of my earlier templates and see that this will suffice without the <> "NO" condition:

=INDEX($A$1:$A$13,SMALL(IF($B$1:$B2="No",ROW($B$1:$B2)),COUNTIF($B$1:$B2,"No")))
 
Upvote 0
Thanks for the reply! I'm curious, why did you use a countif function? I'm trying to return the value in cell A1 (which is text and not a number) to the cell adjacent to a Yes, and if there is a No, there should be nothing in the adjacent cell. So it should look something like:

View image: ex 5

I'm looking for the function that would make the outputs happen in column c.
 
Upvote 0

Excel 2010
ABC
1aNo
2bYesa
3cYesa
4dNo
5eNo
6fYese
7gYese
8hYese
9iNo
10jYesi
11kNo
12lYesk
Sheet1
Cell Formulas
RangeFormula
C2{=IF(B2="No","",INDEX($A$1:$A$13,SMALL(IF($B$1:$B2<>"No","",ROW($B$1:$B2)),COUNTIF($B$1:$B2,"No"))))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
The count if is the k for the Small formula. The formula in C6 for instance counts 3 "No"s so it wants the third smallest "No" or the third "No", and then get that index in column A.
 
Upvote 0
Another option,

In C2, copy down :

=IF(B2="Yes",LOOKUP(2,1/(B$1:B2="No"),A$1:A2),"")
 
Upvote 0

Forum statistics

Threads
1,216,073
Messages
6,128,638
Members
449,461
Latest member
kokoanutt

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