Google sheets wildcard lookups

gorem

Board Regular
Joined
Sep 28, 2013
Messages
188
I'm not sure if it's heresy to ask about Google Sheets here, but I have a wildcard lookup question and figured you all are the most reliable source. I'm helping out a friend whose organization uses Google Sheets (the reason I can't just solve this in Excel).

In this scenario, dates on a calendar are the lookup values (e.g. 9/1/2014). On another sheet, I want to either return a value corresponding to either "9/1/2014" or "9/1/2014 pm" in an adjacent cell (only one or the other will ever be represented). One other variable to consider is that there are sometimes trailing spaces or different numbers of spaces between the date and the "pm". In Excel, I would do something like =INDEX(Sheet2!C:C,MATCH(A2&"*pm*",Sheet2!A:A,0)).

However, I've read that Google Sheets doesn't support wildcards in the same way as Excel. People recommend some combination of FILTER and SEARCH, which are totally foreign to me. I used to following workaround, but wondering if others have more flexible solutions that will take variations of the lookup value into account:

=IFERROR(IFERROR(INDEX(Sheet2!$E:$E,MATCH(E3&" pm",Sheet2!$B:$B,0)),INDEX(Sheet2!$E:$E,MATCH(E3,Sheet2!$B:$B,0))),"")

Thanks in advance!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Is there a need to repeat the INDEX?

=IFERROR(INDEX(Sheet2!$E:$E,IFERROR(MATCH(E3&" pm",Sheet2!$B:$B,0),MATCH(E3,Sheet2!$B:$B,0))),"")
 

gorem

Board Regular
Joined
Sep 28, 2013
Messages
188
Excellent point! No, yours is more efficient.

I still would love to know how to deal with variations in my lookup array, however. The formula above doesn't take some fuzzy matches into account given the wildcard limitations in Google Sheets


Thanks!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,148
Messages
5,835,680
Members
430,374
Latest member
PeteBrown

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
Top