Excel Formula

Jknightt

New Member
Joined
Aug 6, 2007
Messages
1
I need to create a formula that extracts the role/purpose of the server from the server name.

Example Server Names:
ttnetc10s13xth1
uk-bs-wr-1
ttnet-c3s12-wr2

In these examples, "XTH", "WR" and "WR" are the server roles. I would like to create a formula that examines the name and if the name contains "WR" then populate the field with WR. If the names contains "XTH" then populate the field with XTH. There will NEVER be a situation where a server name will contain 2 of the scenario's. The only issue is there are around 20 server role scenarios. I cannot file a "if contains" formula.

Any help would be greatly appreciated.

Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Diffy

Well-known Member
Joined
Dec 22, 2006
Messages
512
Say the server name is in A1, try this:

=if(isnumber(find("wr",A1,1)),"WR",if(isnumber(find("xth",A1,1)),"XTH",""))
 
Upvote 0

Forum statistics

Threads
1,191,092
Messages
5,984,619
Members
439,896
Latest member
SquareCare

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
Top