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!
[TABLE="width: 500"]
<tbody>[TR]
[TD]234[/TD]
[TD]tennis[/TD]
[/TR]
[TR]
[TD]4234[/TD]
[TD]football[/TD]
[/TR]
[TR]
[TD]546[/TD]
[TD]tennis[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]tennis[/TD]
[/TR]
[TR]
[TD]456456[/TD]
[TD]football[/TD]
[/TR]
[TR]
[TD]40[/TD]
[TD]football[/TD]
[/TR]
[TR]
[TD]54645[/TD]
[TD]tennis[/TD]
[/TR]
[TR]
[TD]456[/TD]
[TD]tennis[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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