Formula that would pick the last value in a column depending on the value in the next column

Dudi Shvejk

New Member
Joined
Aug 9, 2017
Messages
5
Hi everyone!
I need your help with the following issue.
I need a formula that would insert into a cell the last value from the first column depending on the wording in the second column. In other words, I need a formula that would insert into one cell the value of 40 (which is the last value with "football") and into another cell it should insert 456 (which is the last value for "tennis").
Thank you!
234tennis
4234football
546tennis
4tennis
456456football
40football
54645tennis
456tennis

<tbody>
</tbody>
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Re: Help with the formula that would pick the last value in a column depending on the value in the next column


Excel 2016 (Windows) 32 bit
ABCDE
1234tennistennis456
24234football
3546tennis
44tennis
5456456football
640football
756645tennis
8456tennis
Sheet1
Cell Formulas
RangeFormula
E1=LOOKUP(2,1/($B$1:$B$8=$D$1),$A$1:$A$8)


WBD
 
Last edited:
Upvote 0
Re: Help with the formula that would pick the last value in a column depending on the value in the next column

Perhaps something like = lookup(2,1/(b1:b10="football"),a1:a10)
Same for tennis
Adapt range as needed
 
Upvote 0
Re: Help with the formula that would pick the last value in a column depending on the value in the next column

Thank you very much!
 
Upvote 0
Re: Help with the formula that would pick the last value in a column depending on the value in the next column

Thank you!
 
Upvote 0
Re: Help with the formula that would pick the last value in a column depending on the value in the next column

Can you something like this for the last text entry? =index($B$1:$B$8,match("Ω",$B$1:$B$8)) Use Alt+234 to produce Ω
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,194
Members
449,072
Latest member
DW Draft

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