# Thread: Check first & last letter from 2 columns against a column of words Thanks:  1 Post #5315760 (1) Likes:  1 Post #5315760 (1)

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

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.

2. ## Re: Check first & last letter from 2 columns against a column of words

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

3. ## Re: Check first & last letter from 2 columns against a column of words

Perfect! I assume the AND is the IF/BOOL so that is why I didn't need them...

Thank you!

4. ## Re: Check first & last letter from 2 columns against a column of words

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.

5. ## Re: Check first & last letter from 2 columns against a column of words

Here is another formula that should work...

=REPLACE(TRIM(C1),2,LEN(TRIM(C1))-2,"")=A\$1&B\$1

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•