Excel/Conditional formula question
With my clients, they get placed into 2 categories based on the last 2 numbers of their ID number, I am trying to write a formula that will place an indicator in a cell based on what the last 2 numbers of their ID number. For example, 432048210 would indicate a male client, and 432041220 would indicate a female client. Is there a way to write a formula to have a wildcard and look for those indicators and place the result in another cell? Thank you in advance, I have tried every conditional operation that I could think of and am stumped.
Thank you for your question. I believe I can help you with this.
However, I am not for sure if you are wanting something (like "Male" or "Female") placed in an adjacent cell, or, if you are wanting the ID number formatted differently for male and female clients. Since the subject was Conditional Formula question, I assume you want a conditional formatting. But I will give you a solution for both.
First, let's assume your data is in Column A with the first ID number in A1. If not, then adjust the formulas I provide to match your data. In Cell B1, place this formula:
Then copy and paste the formula down as far as your data extends. Since the ID number of male clients ends in "10," all ID numbers ending in "10" will say "Male." The other ID numbers will say "Female" by default.
If you want something other than "Male" or "Female" in the cell, then change that part of the formula I gave you.
Conditional Formatting Solution.
If you are wanting the ID numbers to be formatted to easily identify them as male or female, then the steps below will do that.
First, highlight the range of data (the list of ID numbers). Depending upon which version of Excel you are using, go to the Home tab and click on Conditional Formatting. Click on "New Rule" and then click on "Use a formula to determine which cells to format." You will then see a box to place a formula. Place this formula: =(RIGHT(A1,2)="10")and then click the format button just below and select the formatting you want the cell to have for the male clients. Then repeat the action (New Rule, etc) and use the same formula, except change the "10" to "20" and select the formatting you want for the female clients.
I hope this helped and that one of the solutions is what you were looking for. If not, send me a follow-up and we will keep at it until we get it the way you want it.
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here