Help in IF formula for multiple text

chris1979

Board Regular
Joined
Feb 23, 2016
Messages
52
I require assistance in a if (or any function). I have a report with different email domains but have a different name in the company columns
Sender_EmailCOMPANY_NAMEFinal
ABC@ABC.comABC
BCA@service.comBCA
XYZ@data.comBCA
I want a formula
  1. where if the company in column "Company Name" is ABC then it should remain as ABC in column "Final "
  2. where the company in column "Company Name" is BCA then check column "Sender_Email.....check the domain name and update the column "Final" as "Service" (if the domain is service.com) and "Data" (if the domain is data.com)

I tried with if and replace but didnt work

Thanks for the help
CT
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Try, in C2:
Excel Formula:
=IF(B2="ABC",B2,MID(A2,FIND("@",A2)+1,FIND(".",A2,FIND("@",A2))-FIND("@",A2)-1))
Then copy down

Bye
 
Upvote 0
Hi. So you are essentially looking for the domain name between "@" and ".com", I would ignore the second column as it'd be easier to startover.
Try this in C2 and drag down.
Excel Formula:
=MID(A2,FIND("@",A2)+1,LEN(A2)-FIND("@",A2)-4)

The formula assumes it's always ".com" or ".???" at the end, let me know if otherwise.
 
Upvote 0
Thank very much for your reply....it did work for most of the cells. I just discovered that deep down in the data set that there are different variables in the domain.

I have to make a change where

Condition
  1. If the column B is equal to XYZ then go to column A...check the domain and give me the correct domain (like service-abc) in column C (highlighted) otherwise retain the same value as listed in the column B (like IPM,TTT etc)
Thanks a lot for your help
 
Upvote 0
Excuse me, but are you really trying to get the company name from an email address?
 
Upvote 0
Yes Anthony....but the condition is if it is listed as XYZ then check the email address otherwise retain the same value as listed in column B
 
Upvote 0
工作簿1.xlsx
ABC
1Sender_EmailCOMPANY_NAMEFinal
2ABC@ABC.comABCABC
3BCA@service.comXYZSERVICE
4XYZ@data.comBCABCA
Sheet1
Cell Formulas
RangeFormula
C2:C4C2=IF(B2="XYZ",UPPER(MID(A2,FIND("@",A2)+1,FIND(".",A2)-FIND("@",A2)-1)),B2)
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,172
Members
449,071
Latest member
cdnMech

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