#1   Report Post  
Posted to microsoft.public.excel.programming
Joe Joe is offline
external usenet poster
 
Posts: 476
Default IF Formula

I have lists of insurance names followed by their types in once cell
example:
cigna WC
Aetna GRP
Progressive PIP

i would like to have a column that would show me the type so i can sort by
type (my report doesnt have 'type' column)

i need the formula to say
"if cell contains 'WC' then the result equal 1, if the cell contains 'grp'
then the result would equal 2, if the cell contains 'PIP' then the result
would equal 3"

i cannot figure out how to write that kind of formula

thank you MS community
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default IF Formula

Since both Name & Type are in one cell, assuming your first cell is A1, put
this in B1 and drag down.

=IF(ISERROR(SEARCH("wc",A1)),IF(ISERROR(SEARCH("gr p",A1)),IF(ISERROR(SEARCH("pip",A1)),"Type
not found",3),2),1)

Search is not case sensitive and will produce a #VALUE! error if the Value
is not found. By using IsError function, value not found = True, value found
= False; reverse logic at work here. If first value not found (IsError =
True), then go to the next IF statement, etc.
Change the reference to A1 in the formula to wherever your first data cell
is.

Mike F

"Joe" wrote in message
...
I have lists of insurance names followed by their types in once cell
example:
cigna WC
Aetna GRP
Progressive PIP

i would like to have a column that would show me the type so i can sort by
type (my report doesnt have 'type' column)

i need the formula to say
"if cell contains 'WC' then the result equal 1, if the cell contains 'grp'
then the result would equal 2, if the cell contains 'PIP' then the result
would equal 3"

i cannot figure out how to write that kind of formula

thank you MS community



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default IF Formula

Try this formula, if no match, you will get 0. FYI, the Find function is
case sensitive.

=ISNUMBER(FIND("WC",A1))*1+ISNUMBER(FIND("GRP",A1) )*2+ISNUMBER(FIND("PIP",A1))*3

HTH
--
Data Hog


"Joe" wrote:

I have lists of insurance names followed by their types in once cell
example:
cigna WC
Aetna GRP
Progressive PIP

i would like to have a column that would show me the type so i can sort by
type (my report doesnt have 'type' column)

i need the formula to say
"if cell contains 'WC' then the result equal 1, if the cell contains 'grp'
then the result would equal 2, if the cell contains 'PIP' then the result
would equal 3"

i cannot figure out how to write that kind of formula

thank you MS community

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula PJ[_3_] Excel Worksheet Functions 2 June 2nd 10 03:45 PM
extract formula result form cell without running formula again jason Excel Programming 4 August 14th 09 02:01 AM
copy formula down a column and have cell references change within formula brad New Users to Excel 5 May 13th 07 04:38 PM
Formula expected end of statement error, typing formula into cell as part of VBA macro [email protected] Excel Programming 1 July 20th 06 07:58 PM
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


All times are GMT +1. The time now is 03:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"