Lookup

Deelof

New Member
Joined
Aug 30, 2023
Messages
34
Office Version
  1. 2019
Platform
  1. Windows
How can I write a formula if a cell either starts with certain characters or the full cell contents are equal to another to return a value?

For example, cell content is TB00192-3 and either starts with TB or completely matches TB00192-3 returns the same value?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi,

maybe something like this can help you ?

Book1
ABCDEFG
1
2TB00192-3TB00TRUE
3
Sheet2
Cell Formulas
RangeFormula
G2G2=IFERROR(SEARCH(D2,B2)>0,FALSE)
 
Upvote 0
Hi,

maybe something like this can help you ?

Book1
ABCDEFG
1
2TB00192-3TB00TRUE
3
Sheet2
Cell Formulas
RangeFormula
G2G2=IFERROR(SEARCH(D2,B2)>0,FALSE)
Thanks, I need to look up to this list and return "X" if the cell value matches or starts with any of the below.
So, TB00192-3 would match as there are no others starting with TB.

BK
WM
DW
SA
KT
TS
STA
FF
FP
TV
CK
IB
IR
MW
VC
BU
GM
HD
UNGLUED
FD
TB00192-1
SB00135-1
SB00137-1
SD00068-1
SD00068-3
SB00200-2
TB00070-1
TB00194-3
TB00194-4
TB00192-3
TB00192-2
BE00067-1
TB00283-1
 
Upvote 0
hi there,

if your list starts in B5, you can try:

C2
Excel Formula:
=IF(SUM(IFERROR(MATCH($B$5:$B$37,LEFT(B2,LEN($B$5:$B$37)),0),))>0,"X","")
 
Upvote 0
hi there,

if your list starts in B5, you can try:

C2
Excel Formula:
=IF(SUM(IFERROR(MATCH($B$5:$B$37,LEFT(B2,LEN($B$5:$B$37)),0),))>0,"X","")
Thanks, that's worked but what if the cell contents are not on the list how can I expand the formula to say if B5 is not on the list then look to another tabs data and return the value if B5 is found? I've tried to add the below but errors:-

=IF(ISNA(VLOOKUP($B5,'extract 2.10.23'!$I:$L,4,FALSE)),"NOT ON WEB",VLOOKUP($B5,'extract 2.10.23'!$I:$L,4,FALSE)))
 
Upvote 0
I would recommend you close this thread (mark above as a solution), and then open a new thread topic with your new requirements.

The benefit of that will be that many new people will see it, and you have more chance of a fix.

Hope thats okay.

cheers
Rob
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,975
Members
449,095
Latest member
Mr Hughes

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