Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mark G
 
Posts: n/a
Default Multiple IF THEN ELSE statment

I have a list that has column for pricing and a column for price code. the
price code has 1 of 5 different letters for discounts. codes are as follows:
d,f,k,n,v. each code has a different vaule. Can I make a multiple IF THEN
ELSE statement that would choose the correct formula? ie.. IF(code=d, then
price*.8 else IF code=f then price*.85 else IF code=k then price*.9 else IF
code=n then price*.75 else IF code=v then price*.7) all in one function?
--
MsG
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default


=A1*CHOOSE(MATCH(B1,{"d";"f";"k";"n";"v"},0),0.8,0 .85,0.9,0.75,0.7)


--

HTH

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


"Mark G" wrote in message
...
I have a list that has column for pricing and a column for price code. the
price code has 1 of 5 different letters for discounts. codes are as

follows:
d,f,k,n,v. each code has a different vaule. Can I make a multiple IF

THEN
ELSE statement that would choose the correct formula? ie.. IF(code=d,

then
price*.8 else IF code=f then price*.85 else IF code=k then price*.9 else

IF
code=n then price*.75 else IF code=v then price*.7) all in one function?
--
MsG



  #3   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

Another solution:
=A1*((B1="d")*0.8+(B1="f")*0.85+(B1="k")*0.9+(B1=" n")*0.75+(B1="v")*0.7)


Arvi Laanemets


"Mark G" wrote in message
...
I have a list that has column for pricing and a column for price code. the
price code has 1 of 5 different letters for discounts. codes are as

follows:
d,f,k,n,v. each code has a different vaule. Can I make a multiple IF

THEN
ELSE statement that would choose the correct formula? ie.. IF(code=d,

then
price*.8 else IF code=f then price*.85 else IF code=k then price*.9 else

IF
code=n then price*.75 else IF code=v then price*.7) all in one function?
--
MsG



  #4   Report Post  
Duke Carey
 
Posts: n/a
Default

And yet another approach would be to put the codes & discounts in a table,
then use a VLOOKUP() formula. The primary reason for doing it this way is if
you ever saw the need to add new price codes or modify the discounts. Much
easier to modifiy the table than grinding through the formulas

Duke

"Mark G" wrote:

I have a list that has column for pricing and a column for price code. the
price code has 1 of 5 different letters for discounts. codes are as follows:
d,f,k,n,v. each code has a different vaule. Can I make a multiple IF THEN
ELSE statement that would choose the correct formula? ie.. IF(code=d, then
price*.8 else IF code=f then price*.85 else IF code=k then price*.9 else IF
code=n then price*.75 else IF code=v then price*.7) all in one function?
--
MsG

  #5   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

I'm always keeping saying: "In Excel you can everything do at least i 3
different ways!". Lookup table isn't the only way to make this solution
dynamic, p.e. you can use (dynamic in current situation) names for this
instead :-)


Arvi Laanemets


"Duke Carey" wrote in message
...
And yet another approach would be to put the codes & discounts in a table,
then use a VLOOKUP() formula. The primary reason for doing it this way is

if
you ever saw the need to add new price codes or modify the discounts.

Much
easier to modifiy the table than grinding through the formulas

Duke

"Mark G" wrote:

I have a list that has column for pricing and a column for price code.

the
price code has 1 of 5 different letters for discounts. codes are as

follows:
d,f,k,n,v. each code has a different vaule. Can I make a multiple IF

THEN
ELSE statement that would choose the correct formula? ie.. IF(code=d,

then
price*.8 else IF code=f then price*.85 else IF code=k then price*.9 else

IF
code=n then price*.75 else IF code=v then price*.7) all in one function?
--
MsG





  #6   Report Post  
Mark G
 
Posts: n/a
Default

Thanks - worked great.

"Bob Phillips" wrote:


=A1*CHOOSE(MATCH(B1,{"d";"f";"k";"n";"v"},0),0.8,0 .85,0.9,0.75,0.7)


--

HTH

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


"Mark G" wrote in message
...
I have a list that has column for pricing and a column for price code. the
price code has 1 of 5 different letters for discounts. codes are as

follows:
d,f,k,n,v. each code has a different vaule. Can I make a multiple IF

THEN
ELSE statement that would choose the correct formula? ie.. IF(code=d,

then
price*.8 else IF code=f then price*.85 else IF code=k then price*.9 else

IF
code=n then price*.75 else IF code=v then price*.7) all in one function?
--
MsG




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
Can I get the mode, min, and max with multiple criteria? BobT Excel Discussion (Misc queries) 1 February 15th 05 03:20 AM
adding certain cells in multiple worksheets in multiple workbooks Stephen via OfficeKB.com Excel Worksheet Functions 1 February 4th 05 08:31 PM
Return Multiple Results with Lookup Josh O. Excel Worksheet Functions 1 February 4th 05 08:07 PM
XML / parent with multiple children and with multiple children Richard Excel Discussion (Misc queries) 0 January 5th 05 11:49 AM
How do I avoid saving multiple Excel/Wordfiles for versioning purp Neil Excel Discussion (Misc queries) 1 December 13th 04 12:57 PM


All times are GMT +1. The time now is 06:18 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"