Pelican Parts
Parts Catalog Accessories Catalog How To Articles Tech Forums
Call Pelican Parts at 888-280-7799
Shopping Cart Cart | Project List | Order Status | Help



Go Back   Pelican Parts Forums > Miscellaneous and Off Topic Forums > Off Topic Discussions


Reply
 
LinkBack Thread Tools Rate Thread
Author
Thread Post New Thread    Reply
The Unsettler
 
stomachmonkey's Avatar
 
Join Date: Dec 2002
Location: Lantanna TX
Posts: 23,885
Send a message via AIM to stomachmonkey
Quick excel help needed

Need an IF THEN OR formula for excel.

I need to calculate sales tax for 3 specific states, but not the other 47, that will be identified as NY, SC, OH so I need a formual that says "if (cell x) = NY then calculate sales tax based on the total amount column (cell y), else = 0

Make sense?

THX,
SCOTT

__________________
"I want my two dollars"
"Goodbye and thanks for the fish"
"Proud Member and Supporter of the YWL"
"Brandon Won"
Old 01-30-2007, 05:15 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #1 (permalink)
Dept store Quartermaster
 
lendaddy's Avatar
 
Join Date: Jul 2001
Location: I'm right here Tati
Posts: 19,858
I see what you're trying to do and am also interested in the answer as I haven't used those commands since my class in BASIC 20 years ago

One would think it would simply be. IF C6 = NY then (F6*1.08) or whatever, but I doubt it's that obvious. Then ofcourse you need the "otherwise (F6*1).
__________________
Cornpoppin' Pony Soldier
Old 01-30-2007, 05:21 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #2 (permalink)
Semper drive!
 
rcecale's Avatar
 
Join Date: Mar 2002
Location: Atlanta, GA
Posts: 7,538
Garage
I believe what you're looking for is actually an IF-THEN-ELSE function, or a "Nested IF" function.

Randy
__________________
84 944 - Alpine White
86 Carrera Targa - Guards Red - My Pelican Gallery - (Gone, but never forgotten )
One Marine's View
Igitur qui desiderat pacem, praeparet bellum
Old 01-30-2007, 05:30 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #3 (permalink)
Registered
 
Flatbutt1's Avatar
 
Join Date: Nov 2002
Location: NWNJ
Posts: 6,202
Did you try the HELP function? for conditkonal IF,Then




A

15
9
8


Formula Description (Result)
=IF(A2=15, "OK", "Not OK") If the value in cell A2 equals 15, then return "OK". (OK)
=IF(AND(A2>A3, A2 =IF(OR(A2>A3, A2

The IF function uses the following arguments.



Formula with the IF function

logical_test: the condition you want to check

value_if_true: the value to return if the condition is true

value_if_false: the value to return if the condition is false

Function details
AND

OR

IF
__________________
big blue tricycle

stare down the darkness and watch it fade
Old 01-30-2007, 05:30 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #4 (permalink)
Registered
 
Join Date: Dec 2006
Location: MA
Posts: 44
Quote:
Originally posted by Flatbutt1
Microsoft excel :tdown:
__________________
"Don't ever let someone tell you that you can't do something, not even me.''

"You got a dream, you gotta protect it. People can't do something, so they wanna tell you that you can't do it. You want something, go get it. Period.''

"If you think you can, you can. If you think you can't, you're right."
Old 01-30-2007, 05:33 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #5 (permalink)
The Unsettler
 
stomachmonkey's Avatar
 
Join Date: Dec 2002
Location: Lantanna TX
Posts: 23,885
Send a message via AIM to stomachmonkey
Sorry, I'm working on little sleep.

Here's the formula,

IF(j2=10,"=sum(19.99*.0875)",0)

This works, the only problem I have is when you replace "10" with text "NY" I get #NAME as the output and it almost feels like the cell is not formatted properly.
__________________
"I want my two dollars"
"Goodbye and thanks for the fish"
"Proud Member and Supporter of the YWL"
"Brandon Won"
Old 01-30-2007, 05:35 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #6 (permalink)
 
Registered
 
atlporsche's Avatar
 
Join Date: Jul 2002
Location: Just East of Atlanta
Posts: 2,074
= IF(logical test, value if true, value if false)

EDIT:
I'm thinking, =IF(OR(NY,SC,OH),(taxrate*total amt), 0)

you can just use the cell definition for the taxrate i.e. B4 and the cell definition fr the total i.e. G7.

I did something similar, and it worked pretty well.

sjd
__________________
Porsche sold, moving back to muscle cars for a bit.

Last edited by atlporsche; 01-30-2007 at 05:41 PM..
Old 01-30-2007, 05:39 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #7 (permalink)
Virginia Rocks!
 
VaSteve's Avatar
 
Join Date: Oct 2003
Location: Just outside the beltway
Posts: 8,497
there's a couple of ways around it. Here's one to build on:

=IF(C11="ny",0.05,IF(C11="sc",0.06,IF(C11="oh",0.07,0)))


(Ohio has a high tax rate).
__________________
Rosewood 1983 911 SC Targa | Black 1990 944 S2 | White 1980 BMW R65 | Past: Crystal 1986 944 na
Guards Red is for the Unoriginal

Last edited by VaSteve; 01-30-2007 at 05:51 PM..
Old 01-30-2007, 05:48 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #8 (permalink)
Registered
 
atlporsche's Avatar
 
Join Date: Jul 2002
Location: Just East of Atlanta
Posts: 2,074
=IF(OR(A1="NY",A1="SC",A1="OH"),D1*E1, 0)

proven

sjd
__________________
Porsche sold, moving back to muscle cars for a bit.
Old 01-30-2007, 05:51 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #9 (permalink)
Registered
 
atlporsche's Avatar
 
Join Date: Jul 2002
Location: Just East of Atlanta
Posts: 2,074
here's the data group.

NY 1665 45 37
SC 1665 45 37
OH 1665 45 37
CA 0 45 37
FL 0 45 37
OH 1665 45 37
SC 1665 45 37
__________________
Porsche sold, moving back to muscle cars for a bit.
Old 01-30-2007, 05:53 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #10 (permalink)
Semper drive!
 
rcecale's Avatar
 
Join Date: Mar 2002
Location: Atlanta, GA
Posts: 7,538
Garage
=IF(J2="ny",(19.99*0.0875),IF(J2="oh",(19.99*0.065),IF(J2="sc",(19.99*0.05))))

Change the 0.065 and 0.05 values for oh and sc (respectively) to whatever the correct numbers are.


Randy
__________________
84 944 - Alpine White
86 Carrera Targa - Guards Red - My Pelican Gallery - (Gone, but never forgotten )
One Marine's View
Igitur qui desiderat pacem, praeparet bellum
Old 01-30-2007, 05:56 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #11 (permalink)
Registered
 
atlporsche's Avatar
 
Join Date: Jul 2002
Location: Just East of Atlanta
Posts: 2,074
http://office.microsoft.com/en-us/excel/HA012186941033.aspx?pid=CL100570551033

here's a link to returning multiple values from multiple inputs.

sjd
__________________
Porsche sold, moving back to muscle cars for a bit.
Old 01-30-2007, 06:01 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #12 (permalink)
 
The Unsettler
 
stomachmonkey's Avatar
 
Join Date: Dec 2002
Location: Lantanna TX
Posts: 23,885
Send a message via AIM to stomachmonkey
Randy, that works perfectly, one thing, if the 3 conditions do not match (one of the other 47 states) it returns "False" which would be fine but I need to drop this into a database that will not accept false, can we make the formula spit out a value of 0?
__________________
"I want my two dollars"
"Goodbye and thanks for the fish"
"Proud Member and Supporter of the YWL"
"Brandon Won"
Old 01-30-2007, 06:07 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #13 (permalink)
Virginia Rocks!
 
VaSteve's Avatar
 
Join Date: Oct 2003
Location: Just outside the beltway
Posts: 8,497
Mine does.
__________________
Rosewood 1983 911 SC Targa | Black 1990 944 S2 | White 1980 BMW R65 | Past: Crystal 1986 944 na
Guards Red is for the Unoriginal
Old 01-30-2007, 06:13 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #14 (permalink)
jyl jyl is online now
Registered
 
jyl's Avatar
 
Join Date: Jan 2002
Location: Nor California & Pac NW
Posts: 24,675
Garage
Basically you want to do something like

=IF([cell reference]="NY",[formula w/ sales tax],[formula w/o sales tax])

For example

=IF(A10="NY",B10*1.06,B10)

But you have to charge sales tax in three states, NY SC and OH? If it is the same tax rate in all states, then try

=IF(OR(A10="NY",A10="SC",A10="OH"),B10*1.06,B10)

If there is a different tax rate in each state, you can used nested IFs or a VLOOKUP table.

Nested IFs would be like

=IF(A10="NY",B10*1.06,IF(A10="SC",B10*1.065,IF(A10="OH",B10*1.07,B10)))

Nested IFs are ugly, so personally I would set up a 2-col x 3-row table with NY SC OH down one column and 1.06 1.065 1.07 down the other column. Suppose that table is located in cells I23:J25. Then

=IF(ISERROR(VLOOKUP(C23,$I$23:$J$25,2,FALSE)),1,VL OOKUP(C23,$I$23:$J$25,2,FALSE))

will give you 1.06 if C23 is "NY", 1.065 if it is SC, 1.07 if it is OH, and 1 if it is anything else.

The VLOOKUP approach lets you easily change the tax rates, add more states to tax, etc, and is way easier to read and debug than yucky nested IFs.

P.S. Wow, no shortage of responses, all posted while I was typing mine. Randy's formula needs a term telling it what to return if none of the IFs are true, i.e. if the state is not NY SC or OH, that is probably why you are getting the "False".

PM me your email and I will email you the spreadsheet I did to test the VLOOKUP method I posted.
__________________
1989 3.2 Carrera coupe; 1988 Westy Vanagon, Zetec; 1986 E28 M30; 1994 W124; 2004 S211
What? Uh . . . “he” and “him”?

Last edited by jyl; 01-30-2007 at 06:20 PM..
Old 01-30-2007, 06:14 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #15 (permalink)
The Unsettler
 
stomachmonkey's Avatar
 
Join Date: Dec 2002
Location: Lantanna TX
Posts: 23,885
Send a message via AIM to stomachmonkey
Thanks for the help guys.

I need to get some rest and do this again tomorrow. Running on 4 hours sleep in the last 48 hours.

I need to double check my sheet before I charge 200 orders to the wrong customers.

Word to the wise. If you are doing ecomm and need a merchant account use authorize.net Use them for 5 other sites and you can customize the order of the info in your batch file.

This project is using a different merchant account that has a strict format for the order of the fields but the data coming in from the call center does not match so I need to redo each batch file.
__________________
"I want my two dollars"
"Goodbye and thanks for the fish"
"Proud Member and Supporter of the YWL"
"Brandon Won"
Old 01-30-2007, 06:21 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #16 (permalink)
Semper drive!
 
rcecale's Avatar
 
Join Date: Mar 2002
Location: Atlanta, GA
Posts: 7,538
Garage
Try this one, Scott!

=IF(J2="ny",(19.99*0.0875),IF(J2="oh",(19.99*0.065),IF(J2="sc",(19.99*0.05),0)))

Cheers!

Randy
__________________
84 944 - Alpine White
86 Carrera Targa - Guards Red - My Pelican Gallery - (Gone, but never forgotten )
One Marine's View
Igitur qui desiderat pacem, praeparet bellum
Old 01-30-2007, 06:30 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #17 (permalink)
jyl jyl is online now
Registered
 
jyl's Avatar
 
Join Date: Jan 2002
Location: Nor California & Pac NW
Posts: 24,675
Garage
Get some sleep, you're way past the point of diminishing returns.

__________________
1989 3.2 Carrera coupe; 1988 Westy Vanagon, Zetec; 1986 E28 M30; 1994 W124; 2004 S211
What? Uh . . . “he” and “him”?
Old 01-30-2007, 06:36 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #18 (permalink)
Reply


 


All times are GMT -8. The time now is 11:32 AM.


 
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0
Copyright 2025 Pelican Parts, LLC - Posts may be archived for display on the Pelican Parts Website -    DMCA Registered Agent Contact Page
 

DTO Garage Plus vBulletin Plugins by Drive Thru Online, Inc.