Excel formula if two cells have same word

shacol03

New Member
Joined
Oct 24, 2017
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hi,

Please help me, how to make a formula if two cells have multiple words and if they have same word will become true.
Example.

I want in Column C will "True" if Column A & B have same word.

ABC
Fc Innsbruck UnionFc Stated InnsbruckTrue
Fc HoechstBlau Hoechst FeldkirchTrue
Al HiddQalaliFalse
Dinamo MinskMinsk MozyrTrue

<tbody>
</tbody>

Thank you & Regards,
Roy
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Welcome to the forum.

This kind of thing is never pretty using formulas. It's much easier to maintain with a VBA user-defined function. However, the following formula does seem to work:

ABC
1Fc Innsbruck UnionFc Stated InnsbruckTRUE
2Fc HoechstBlau Hoechst FeldkirchTRUE
3Al HiddQalaliFALSE
4Dinamo MinskMinsk MozyrTRUE
5The Balloon Place100 Ball CourtFALSE
6100 Ball CourtThe Balloon PlaceFALSE
7ABC Jack StreetBlackjack wayFALSE
8Blackjack wayABC Jack StreetFALSE
9This is a very long line to test itI don't know if every word here works very wellTRUE
10This is a long line to test itI don't know if every word here works very wellFALSE
11TRUE

<tbody>
</tbody>
Sheet5

Array Formulas
CellFormula
C1{=ISNUMBER(AGGREGATE(15,6,SEARCH(MID(" "&A1&" ",IF(MID(" "&A1&" ",ROW(INDIRECT("1:"&LEN(A1)+1)),1)=" ",ROW(INDIRECT("1:"&LEN(A1)+1)),NA()),FIND(" "," "&A1&" ",ROW(INDIRECT("2:"&LEN(A1)+2)))-ROW(INDIRECT("1:"&LEN(A1)+1))+1)," "&B1&" "),1))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>


Note 1: AGGREGATE was added in 2010, older versions of Excel can't handle this formula.

Note 2: When pasting your sample data, the spaces came across as character code 160. I don't know if that's how the data really is, or if it's just an artifact of the copy/pasting process. If the data actually has code 160 instead of spaces, change every instance of " " to CHAR(160) in the formula. Or use Replace All.
 
Last edited:
Upvote 0
Welcome to the forum.

This kind of thing is never pretty using formulas. It's much easier to maintain with a VBA user-defined function. However, the following formula does seem to work:

ABC
1Fc Innsbruck UnionFc Stated InnsbruckTRUE
2Fc HoechstBlau Hoechst FeldkirchTRUE
3Al HiddQalaliFALSE
4Dinamo MinskMinsk MozyrTRUE
5The Balloon Place100 Ball CourtFALSE
6100 Ball CourtThe Balloon PlaceFALSE
7ABC Jack StreetBlackjack wayFALSE
8Blackjack wayABC Jack StreetFALSE
9This is a very long line to test itI don't know if every word here works very wellTRUE
10This is a long line to test itI don't know if every word here works very wellFALSE
11TRUE

<tbody>
</tbody>
Sheet5

Array Formulas
CellFormula
C1{=ISNUMBER(AGGREGATE(15,6,SEARCH(MID(" "&A1&" ",IF(MID(" "&A1&" ",ROW(INDIRECT("1:"&LEN(A1)+1)),1)=" ",ROW(INDIRECT("1:"&LEN(A1)+1)),NA()),FIND(" "," "&A1&" ",ROW(INDIRECT("2:"&LEN(A1)+2)))-ROW(INDIRECT("1:"&LEN(A1)+1))+1)," "&B1&" "),1))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>


Note 1: AGGREGATE was added in 2010, older versions of Excel can't handle this formula.

Note 2: When pasting your sample data, the spaces came across as character code 160. I don't know if that's how the data really is, or if it's just an artifact of the copy/pasting process. If the data actually has code 160 instead of spaces, change every instance of " " to CHAR(160) in the formula. Or use Replace All.


Hi Sir Eric,

Thank you for the reply.

I'm sorry I have another problem. I want to apply in column (example below)

I want to put True in Column B, If Column A have same word in Column E within the column.

ABE
1Fc Innsbruck UnionTrueBlau Hoechst Feldkirch
2Fc HoechstTrueFc Stated Innsbruck
3Al HiddFalseMinsk Mozyr
4Dinamo MinskTrueQalali
5The Balloon PlaceTrueThe Balloon Place
6100 Ball CourtTrueBlackjack Ace
7ABC Jack StreetFalseCourt B

<tbody>
</tbody>
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
ABC
1Fc Innsbruck UnionFc Stated InnsbruckTRUE
2Fc HoechstBlau Hoechst FeldkirchTRUE
3Al HiddQalaliFALSE
4Dinamo MinskMinsk MozyrTRUE
5The Balloon Place100 Ball CourtFALSE
6100 Ball CourtThe Balloon PlaceFALSE
7ABC Jack StreetBlackjack wayFALSE
8Blackjack wayABC Jack StreetFALSE
9This is a very long line to test itI don't know if every word here works very wellTRUE
10This is a long line to test itI don't know if every word here works very wellFALSE
11TRUE


<tbody>
</tbody>
</body>
Thanks & Regards

HUHUHUHU -_-
 
Upvote 0
Just put the formula in B1 instead of C1, and change the B1 near the end to a C1.
 
Upvote 0

Forum statistics

Threads
1,215,483
Messages
6,125,065
Members
449,206
Latest member
Healthydogs

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