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

#### Dudi Shvejk

##### New Member
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!
 234 tennis 4234 football 546 tennis 4 tennis 456456 football 40 football 54645 tennis 456 tennis

<tbody>
</tbody>

### Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

#### wideboydixon

##### Well-known Member
Re: Help with the formula that would pick the last value in a column depending on the value in the next column

WBD

Last edited:

#### arthurbr

##### Well-known Member
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

#### Dudi Shvejk

##### New Member
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!

#### Dudi Shvejk

##### New Member
Re: Help with the formula that would pick the last value in a column depending on the value in the next column

Thank you!

#### Mike Szczesny

##### Active Member
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 Ω