Find last matching cell using wildcard

Pritch

New Member
Joined
May 25, 2006
Messages
12
I am trying to find a formula to match the last cell in a row range containing a set character and return the value from another row in the same column.

The closest solution I can find is:-
=LOOKUP(2,1/(A1:A10=J1),B1:B10)

but this only appears to work for exact matches.
Does anybody know how to use wildcard characters with this, or does anybody have any other suggestions?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
In this example I want the result in column R to be the value in row 8 for the last column containing the letter O
last matching cell.xls
CDEFGHIJKLMNOPQR
82.002.032.002.032.062.092.122.153.003.033.063.093.123.153.18desiredresult
9OXXO2.15
10OXO3.06
11OXOXXO2.12
12XXX
13X-XOXXO3.18
14XO3.12
15XO-OXXX3.03
16XOXXOXO2.15
17---OXOXXX3.12
U15BHJ
 
Upvote 0
Like this?
Book2
CDEFGHIJKLMNOPQR
82.002.032.002.032.062.092.122.153.003.033.063.093.123.153.18desired result
9OXXO2.15
10OXO3.06
11OXOXXO2.12
12XXX 
13X-XOXXO3.18
14XO3.12
15XO-OXXX3.03
16XOXXOXO2.15
17---OXOXXX3.12
Sheet1



Formula in R9: =IF(OR(ISNUMBER(SEARCH("O",C9:Q9))),LOOKUP(2,1/ISNUMBER(SEARCH("O",C9:Q9)),$C$8:$Q$8),"")

confirmed with CTRL+SHIFT+ENTER not just ENTER copied down.
 
Upvote 0
That's spot on

Many thanks

I think my original suggestion was a little overkill, now that I look at it again .....

you could eliminate the Isnumber() checks and replace with this formula in R9 and you only need to confirm simply with ENTER.

=IF(COUNTIF(C9:Q9,"*O*"),LOOKUP(2,1/SEARCH("O",C9:Q9),$C$8:$Q$8),"")

or =IF(COUNTIF(C9:Q9,"*O*"),LOOKUP(9.99999999999999E+307,SEARCH("O",C9:Q9),$C$8:$Q$8),"") implementing "faster" method suggested by Aladin.
 
Upvote 0

Forum statistics

Threads
1,215,950
Messages
6,127,897
Members
449,411
Latest member
AppellatePerson

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