Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Monte
 
Posts: n/a
Default Can wildcards be used in the Logic Test of an Excel "IF" function?

Currently, I'm using seven nested "IF" functions to return one of three
account numbers. Is it possible to use a wildcard in the Logic Test to
decrease the formula to three nested "IF" functions? If so, how? If not, any
suggestions?

current formula: =if (cell contents = "CIR CC", return "110",if (cell
contents = "CIR PC", return "110",if (cell contents = "ADV CC", return
"250",if (cell contents = "ADV PC", return "250",if (cell contents = "ED CC",
return "350",if (cell contents = "ED PC", return "350",""))))))

desired formula: =if (cell contents begins with "C", return "110",if(cell
contents begins with "A", return "250",if(cell contents begins with "E",
return "350", otherwise "")))
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=IF(LEFT(L1,1)="C","110",IF(LEFT(L1,1)="A","250",I F(LEFT(L1,1)="E","350","")
))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Monte" wrote in message
...
Currently, I'm using seven nested "IF" functions to return one of three
account numbers. Is it possible to use a wildcard in the Logic Test to
decrease the formula to three nested "IF" functions? If so, how? If not,

any
suggestions?

current formula: =if (cell contents = "CIR CC", return "110",if (cell
contents = "CIR PC", return "110",if (cell contents = "ADV CC", return
"250",if (cell contents = "ADV PC", return "250",if (cell contents = "ED

CC",
return "350",if (cell contents = "ED PC", return "350",""))))))

desired formula: =if (cell contents begins with "C", return "110",if(cell
contents begins with "A", return "250",if(cell contents begins with "E",
return "350", otherwise "")))



  #3   Report Post  
Monte
 
Posts: n/a
Default

Thanks Bob. That did it.


"Bob Phillips" wrote:

=IF(LEFT(L1,1)="C","110",IF(LEFT(L1,1)="A","250",I F(LEFT(L1,1)="E","350","")))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Monte" wrote in message
...

Currently, I'm using seven nested "IF" functions to return one of three
account numbers. Is it possible to use a wildcard in the Logic Test to
decrease the formula to three nested "IF" functions? If so, how? If not,
anysuggestions?

current formula: =if (cell contents = "CIR CC", return "110",if (cell
contents = "CIR PC", return "110",if (cell contents = "ADV CC", return
"250",if (cell contents = "ADV PC", return "250",if (cell contents = "ED CC",
return "350",if (cell contents = "ED PC", return "350",""))))))

desired formula: =if (cell contents begins with "C", return "110",if(cell
contents begins with "A", return "250",if(cell contents begins with "E",
return "350", otherwise "")))
  #4   Report Post  
Ashish Mathur
 
Posts: n/a
Default

Hi Monte,

You may want to use the Vlookup function. This will free up the problem of
7 cases.

To employ Vlookup, set up a table which list down the codes (CIR CC etc.) in
1 column and numbers in another column. Now use the Vlookup function to
extract numbers from the table. There is good help in the Help menu

Regards,

Ashish Mathur

"Monte" wrote:

Currently, I'm using seven nested "IF" functions to return one of three
account numbers. Is it possible to use a wildcard in the Logic Test to
decrease the formula to three nested "IF" functions? If so, how? If not, any
suggestions?

current formula: =if (cell contents = "CIR CC", return "110",if (cell
contents = "CIR PC", return "110",if (cell contents = "ADV CC", return
"250",if (cell contents = "ADV PC", return "250",if (cell contents = "ED CC",
return "350",if (cell contents = "ED PC", return "350",""))))))

desired formula: =if (cell contents begins with "C", return "110",if(cell
contents begins with "A", return "250",if(cell contents begins with "E",
return "350", otherwise "")))

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
logic stmt. use in a new workbook w/o refering back to original billybob Excel Worksheet Functions 1 August 4th 05 05:21 PM
Wildcards in Functions Graeme Crook Excel Worksheet Functions 1 June 9th 05 11:31 PM
vlookup & wildcards Alex Excel Worksheet Functions 3 June 9th 05 09:41 PM
Statistic: Problem with two one sided t-test Rosario Excel Discussion (Misc queries) 4 May 5th 05 05:23 PM
Excel competency test jonesr2 Excel Discussion (Misc queries) 2 March 14th 05 09:37 PM


All times are GMT +1. The time now is 05:11 AM.

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"