Check first & last letter from 2 columns against a column of words

malaki1974

New Member
Joined
Feb 14, 2006
Messages
46
Hello,

I'd like to check if a word contains matching first/last letters from 2 cells. I can't quite get it to work. In fact, it doesn't work at all - I over sold 'quite'.

Eventually I will check MANY words for MANY different first/last matches so I want to automate obviously.

Example data, example code below.

A B C
First Letter Last Letter Possible Words
L N Learn
Loon

AND(IF(LEFT(TRIM(C1),1)=A1,IF(RIGHT(TRIM(C1),1)=B1)))

Again, I will eventually run this with different words per a/b like loon, lean, loren, etc. and then c/e for choose, chase etc.

Thank you for the help/direction.
 
Last edited:

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
How about
=AND(LEFT(TRIM(C1))=A1,RIGHT(TRIM(C1))=B1)
 
Upvote 0
You're welcome & thanks for the feedback
This LEFT(TRIM(C1))=A1 will return either TRUE or FALSE so no need for the If functions.
 
Upvote 0
Here is another formula that should work...

=REPLACE(TRIM(C1),2,LEN(TRIM(C1))-2,"")=A$1&B$1
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,176
Members
448,948
Latest member
spamiki

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