IF Function based on previous conditional formatting

LJREdinburgh

New Member
Joined
May 20, 2014
Messages
46
Hi,

I am going through a large dataset of about 5000 records with 5 columns. Column D is an e-mail address field on which I have applied conditional formatting to highlight RED if the e-mail address contains "bt" anywhere in the address.

What I am trying to do in Column F is to create an IF formula that will display the text "BT" if a cell in column D is red and if not leave it blank. There might be a way around this without the initial conditional formatting, for the IF formula in column F. However, I can't seem to figure it out and I do not want to go through all the records and manually type BT next to all Red cells.

Thanks
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Cant you use the formula from the conditional formatting inside the IF one, something along the lines of:

IF(your CF formula=true,"BT,"")
 
Upvote 0
This is exactly what I was after. Cuts out the conditional formatting stage. Works perfectly!

I am trying to understand the formula. How is the formula changing what is referring to numbers into text?
 
Upvote 0
Try like this

=IF(ISNUMBER(SEARCH("bt",D1)),"BT","")

This is exactly what I was after. Cuts out the conditional formatting stage. Works perfectly!

I am trying to understand the formula. How is the formula changing what is referring to numbers into text?
 
Upvote 0
The SEARCH function returns a number (character position) if bt is found, otherwise an error. ISNUMBER checks whether it returns a number.
 
Upvote 0
Could you tweak this formula to pick up multiple texts?
Lets say I wanted this to pick up if the e-mail addres had "hotmail" "live" "msn" or "microsoft" and display the text "windows domain" ?
 
Upvote 0
Try like this

=IF(ISNUMBER(SEARCH("bt",D1)),"BT","")

Could tweak this formula to pick up multiple texts?
Lets say I wanted this to pick up if the e-mail addres had "hotmail" "live" "msn" or "microsoft" and display the text "windows domain" ?
 
Upvote 0
There must be a neater way but try

=IF(OR(ISNUMBER(SEARCH("hotmail",D1)),ISNUMBER(SEARCH("live",D1)),ISNUMBER(SEARCH("msn",D1)),ISNUMBER(SEARCH("microsoft",D1))),"windows domain","")
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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