Formula to filter data in columns where some strings are in UPPER case

joy1mat

New Member
Joined
Jun 26, 2016
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm trying to find a formula to help me filter rows that contain some words in upper case. 70% of the range I'm trying to filter has no data in the cell. Cells with data (single or multiple words) all have a leading Capital eg Proper Text or data which contains multiple words with some ALLCAPS. What I need to filter is only those cells where a word in in ALLCAPS so in the example below I only need to filter A4 and A5 eg Mr WORD or Mr POWERPOINT. My workbook has 10K+ rows of data and the data in UPPER are surnames and no surnames are repeated. I've tried many formulas but none of them work so it would be amazing is someone could help with this.

A1 =
A2 = Mr Excel
A3 =
A4 = Mr WORD
A5 = Mr POWERPOINT
A6 =
A7 = Word
 
Hello, maybe something like:

Excel Formula:
=FILTER(A2:A1000,BYROW(A2:A1000,LAMBDA(x,IF(x="",FALSE,OR(EXACT(TEXTSPLIT(x," "),TEXTSPLIT(UPPER(x)," ")))))))

Or if you have REGEX functions:

Excel Formula:
=FILTER(A2:A1000,REGEXTEST(A2:A1000,"\b[A-Z]+\b"))
 
Last edited:
Upvote 0
Hello, maybe something like:

Excel Formula:
=FILTER(A2:A1000,BYROW(A2:A1000,LAMBDA(x,IF(x="",FALSE,OR(EXACT(TEXTSPLIT(x," "),TEXTSPLIT(UPPER(x)," ")))))))

Or if you have REGEX functions:

Excel Formula:
=FILTER(A2:A1000,REGEXTEST(A2:A1000,"\b[A-Z]+\b"))
Hi, I couldn't get either of these to work. The first returned a value for even the blank cells in the column and where there was a cell with an ALLCAPS name included the output of the formula didn't match the row it was against. I don't have REGEX functions so that returns an #NAME? error. Sorry I'm starting to think what I'm after is complex.
 
Upvote 0
The first returned a value for even the blank cells in the column
Are you sure those cells are actually blank and don't contain, say, a space character?
The first formula from post 2 works for me as shown in column C.
I have suggested a shorter formula in column B.

If you still cannot get something to work, perhaps you could give us (with XL2BB ) some dummy sample data to test with?
(If you have trouble with XL2BB, review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of the XL2BB Instructions page linked above.)

25 03 25.xlsm
ABC
1
2Mr ExcelMr WORDMr WORD
3Mr POWERPOINTMr POWERPOINT
4Mr WORD
5Mr POWERPOINT
6
7Word
8
9
10
Filter case
Cell Formulas
RangeFormula
B2:B3B2=FILTER(A2:A10,BYROW(A2:A10,LAMBDA(r,COUNT(FIND(TEXTSPLIT(UPPER(r)," "),r)))))
C2:C3C2=FILTER(A2:A1000,BYROW(A2:A1000,LAMBDA(x,IF(x="",FALSE,OR(EXACT(TEXTSPLIT(x," "),TEXTSPLIT(UPPER(x)," ")))))))
Dynamic array formulas.
 
Upvote 0
Are you sure those cells are actually blank and don't contain, say, a space character?
The first formula from post 2 works for me as shown in column C.
I have suggested a shorter formula in column B.

If you still cannot get something to work, perhaps you could give us (with XL2BB ) some dummy sample data to test with?
(If you have trouble with XL2BB, review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of the XL2BB Instructions page linked above.)

25 03 25.xlsm
ABC
1
2Mr ExcelMr WORDMr WORD
3Mr POWERPOINTMr POWERPOINT
4Mr WORD
5Mr POWERPOINT
6
7Word
8
9
10
Filter case
Cell Formulas
RangeFormula
B2:B3B2=FILTER(A2:A10,BYROW(A2:A10,LAMBDA(r,COUNT(FIND(TEXTSPLIT(UPPER(r)," "),r)))))
C2:C3C2=FILTER(A2:A1000,BYROW(A2:A1000,LAMBDA(x,IF(x="",FALSE,OR(EXACT(TEXTSPLIT(x," "),TEXTSPLIT(UPPER(x)," ")))))))
Dynamic array formulas.
Hi, thank you so much for the help you given me so far. I had a look at setting up the XLB22 Add-on though the device I'm working on isn't mine, so I won't be able to do that. I've created a file with dummy names so you can see the type of data I'm trying to filter and posted an image of what it looks like. The real workbook has over 10K rows so is quite large and there are no hidden characters in the cells that are blank eg C5. I've run both the above formulas and can see these work though I won't be able to filter the results. In column D I'm looking for a formula that allows me to filter the results. In this sample I can filter all the True results and ignor the False ones. The output could be Yes/No or anything that lets me filter the rows to just show those where there is a surname in CAPS. I hope this makes sense.

1742907560388.png
 
Upvote 0
If the inteded outcome is this kind of filter, then you just need to slightly adjust the formula posted by @Peter_SSs above. I.e.

Excel Formula:
=IF(BYROW(A2:A1000,LAMBDA(r,COUNT(FIND(TEXTSPLIT(UPPER(r)," "),r)))),"Yes","No")

or

Excel Formula:
=IF(COUNT(FIND(TEXTSPLIT(UPPER(A2)," "),A3)),"Yes","No")
 
Upvote 0
Similar to what hagia_sofia has mentioned first above in col D or, if you have the TRIMRANGE function (& TrimRefs notation), then you could use the E2 format that will only spill down as far as required.

25 03 25.xlsm
CDE
1
2Alias JONESTRUETRUE
3Alias WHITETRUETRUE
4Alias JoannaFALSEFALSE
5FALSEFALSE
6FALSEFALSE
7Alias MargaretFALSEFALSE
8FALSEFALSE
9Alias ADAMSTRUETRUE
10Alias SarahFALSEFALSE
11FALSEFALSE
12Alias BLACKTRUETRUE
13FALSE
14FALSE
15FALSE
16FALSE
17FALSE
Filter case
Cell Formulas
RangeFormula
D2:D1000D2=BYROW(C2:C1000,LAMBDA(r,COUNT(FIND(TEXTSPLIT(UPPER(r)," "),r))))>0
E2:E12E2=BYROW(C2:.C1000,LAMBDA(r,COUNT(FIND(TEXTSPLIT(UPPER(r)," "),r))))>0
Dynamic array formulas.
 
Upvote 0
Solution
Similar to what hagia_sofia has mentioned first above in col D or, if you have the TRIMRANGE function (& TrimRefs notation), then you could use the E2 format that will only spill down as far as required.

25 03 25.xlsm
CDE
1
2Alias JONESTRUETRUE
3Alias WHITETRUETRUE
4Alias JoannaFALSEFALSE
5FALSEFALSE
6FALSEFALSE
7Alias MargaretFALSEFALSE
8FALSEFALSE
9Alias ADAMSTRUETRUE
10Alias SarahFALSEFALSE
11FALSEFALSE
12Alias BLACKTRUETRUE
13FALSE
14FALSE
15FALSE
16FALSE
17FALSE
Filter case
Cell Formulas
RangeFormula
D2:D1000D2=BYROW(C2:C1000,LAMBDA(r,COUNT(FIND(TEXTSPLIT(UPPER(r)," "),r))))>0
E2:E12E2=BYROW(C2:.C1000,LAMBDA(r,COUNT(FIND(TEXTSPLIT(UPPER(r)," "),r))))>0
Dynamic array formulas.
Hi Peter, yes that did work. You're a legend and I appreciate all your help along with the others who contributed.
 
Upvote 0

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