Sorting by Unique Name

Justijb

New Member
Joined
Aug 16, 2016
Messages
43
Hello All,

Apologies for the multiple posts but I am in search of your expertise as my back is against the wall. I have a spreadsheet that needs to be sorted on Column D (there are column A through N) and over 18k records (rows).

Column D's header is 'Family Name'. I need to highlight in yellow the records that have only one name in it. E.g. Rows 2 and 3 only have 'Regina' while rows 4 through 23 have 'Elizabeth Lastname' and other rows have 3 or 4 words (names). I would need help developing a macro that would highlight the row that has only one word in it.

I'm not sure if this even possible because it is not specific but I figured I've received helped here before.

If any further information Is needed, please let me know.

Fingers crossed.

V/r

JB
 

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.
It sounds to me like this can be done with sorting and Conditional Formatting. Make sure that you clean your data using the trim function to make sure that there are no leading or trailing spaces (e.g. " word", " word ", and "word "). Then you can search for a space in the conditional formatting rule.
 
Upvote 0
For example, let's say that this is your data:


Excel 2010
ABCDEF
1Family Name
2Michael
3John Doe
4Regina
5Elizabeth Lastname
Sheet1


Now highlight A2:N5, Conditional Formatting, New Rule, Use a formula, =NOT(COUNTIF($D2,"* *")), Fill yellow, OK. This will highlight row's 2 and 4 in the above example (specifically cells A2:N2 and A4:N4).
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,013
Members
448,935
Latest member
ijat

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