finding pair of cells with different numbers of words

victorcarreto

New Member
Joined
Jun 28, 2012
Messages
7
Hello, I am dealing with texts, not numbers. Column A has a text in English, and column B a text in Portuguese. I need to find pairs of cells A1-B1 or A1234-B1234 whose number of words have a difference of 9 words minimum. For that I have this formula which I wrote on column C, to identify such case by writing the word “MISMATCH”:

=IF(ABS((LEN(A1)-LEN(SUBSTITUTE(A1," ",""))+1)-(LEN(B1)-LEN(SUBSTITUTE(B1," ",""))+1))>=9,"MISMATCH",0)


The thing is that I don´t want to use a column, like I used column C, to add such a formula, because I would be inserting and deleting cells in column A and B, and the formula loses its reference every time a modification like this is done.
So, what I need is a macro that, with just a shortcut key ,finds next or takes me directly to the next pair of cells in the condition of this formula (I mean, a pair A-B in which A or B has more than 9 words in relation to its pair).
Any idea of how it could be done??


Thank you!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
you dont really need a macro us advanced filter put formula in a spare column say d2
=ABS((LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)-(LEN(B2)-LEN(SUBSTITUTE(B2," ",""))+1))>=9
then used advanced filter / filter the list in place/list range a1:b200
/criteria range d1:d2 (note d1 must be blank)
Sheet1

*ABCD
1engport**
21 2 3 4 5 6 7 8 9 10 11 12 13a*TRUE
32 2 3 4 5 6 7 8 9 10 11 12 13a b**
43 2 3 4 5 6 7 8 9 10 11 12 13a b c d**
54 2 3 4 5 6 7 8 9 10 11 12 13***
65 2 3 4 5 6 7 8 9 10 11 12 13a b c d e**
71 2a b c d e f g h i j k l m n**
8a b c d e f g h i j k l m n o p qa b c d e f g**
9a b c d e f g h i j k l m n o p qa b c d e f g h i j k l m n o p q**
10a b c d e f g h i j k l m n oa b c d e f g h i j k l m n o p q**
115 2 3 4 5 6 7 8 9 10 11 12 13a b c d e**
121 2a b c d e f g h i j k l m n**
13a b c d e f g h i j k l m n o p qa b c d e f g**
14a b c d e f g h i j k l m n o p qa b c d e f g h i j k l m n o p q**
15a b c d e f g h i j k l m n oa b c d e f g h i j k l m n o p q**

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
D2=ABS((LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)-(LEN(B2)-LEN(SUBSTITUTE(B2," ",""))+1))>=9

<tbody>
</tbody>

<tbody>
</tbody>



Excel tables to the web >> Excel Jeanie HTML 4


after filter
Sheet1

*ABCD
1engport**
21 2 3 4 5 6 7 8 9 10 11 12 13a*TRUE
32 2 3 4 5 6 7 8 9 10 11 12 13a b**
43 2 3 4 5 6 7 8 9 10 11 12 13a b c d**
54 2 3 4 5 6 7 8 9 10 11 12 13***
71 2a b c d e f g h i j k l m n**
8a b c d e f g h i j k l m n o p qa b c d e f g**
121 2a b c d e f g h i j k l m n**
13a b c d e f g h i j k l m n o p qa b c d e f g**

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:202px;"><col style="width:246px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
D2=ABS((LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)-(LEN(B2)-LEN(SUBSTITUTE(B2," ",""))+1))>=9

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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