Change Coulour if gender is female


Board Regular

would appreciate any assistance here. I have a cell in sheet Fig 2 that has multiple names. this cell brings names based on a macro from Master_Data sheet. I would like to be able to know who is male and who is female. In Master_Data I have a column which specifies female or male, Column D. Names is Column B.

would appreciate any help if there is a conditional formatting that has if cell A2 contains a name that is female in column D then change to blue.



Well-known Member
Create a new rule using a formula to determine which cells to format. Then add a VLOOKUP (or any other lookup formula) as the rule.

If you want to format several columns at the same time use a fixed reference for the lookup value. Also remember to use exact match with your names.


Board Regular
Hi Misca,

thank you for your reply, In cell B2 Sheet Fig 2 I have multiple names. unfortunately its not working. potentially because i have multiple names in 1 cell.

Appreciate your help.


Well-known Member

You do need to have each name in a cell ...

If your constraint is to keep your current sheet as it is ....

Then you can replicate on a new tab you current sheet ... and generate clean cells ...

Hope this will help


MrExcel MVP, Moderator
As long as A2 only has one name try


Well-known Member
If every name in the row are the same gender you can lookup just the first name and colorcode the row based on that only. To be able to do this within the lookup formula you'd have to know the delimiter. And make sure all the rows with multiple names are constructed the same way. I can't actually recommend this way but it can be done if you really must.

The recommended way would be to have only one person per row and if you must group them, have a different column for the group they belong in. If a person can belong in several groups, there should be a row for that person in each group he/she belongs in.

Some videos you may like

This Week's Hot Topics

  • Get External Data (long shot question!)
    This is likely a long shot but I am wondering if it is at all possible for Excel to somehow 'change' the contents of a URL that is being linked to...
  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • Cell Formatting
    Good Morning, I need to format a few different cells in the following manners: A1 has to always add a colon (:) after whatever is typed in by a...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • Workbook_Change stopped working !
    I am working on an app to speed up & automate processing of Credit Cards statements. After data is input from a CSV file, it is presented to the...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...