Solved

IF formula, more than one arguement?

Posted on 2015-01-14
10
125 Views
Last Modified: 2015-01-15
How would I translate the argument below into a formula?

IF A2 => 12000 but < 24000 then return A2*0.02
IF A2=>24000 but < 36000 then return A2*0.03
IF A2 =>36000 but < 48000 then return A2*0.04
IF A2 =>48000 but < 60000 then return A2*0.05


Hypothetically speaking cell A2 could be populated "1369"

I'm intending on copying the formula down for all values in column 2

Thanks Rob
0
Comment
Question by:robmarr700
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 40548662
Not sure what you want if it's outside those ranges, but you can use LOOKUP:

=IF(OR(A2<12000,A2>=60000),"",A2*LOOKUP(A2,{12000,24000,36000,48000},{0.02,0.03,0.04,0.05})
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 40548684
For the given case you can also try

=(1+INT(A2/12000))/100*A2
0
 

Author Comment

by:robmarr700
ID: 40548692
Good Point Rory see the amended argument below

how would the formula look now?

IF A2<12000 then return A2*0
IF A2 => 12000 but < 24000 then return A2*0.02
IF A2=>24000 but < 36000 then return A2*0.03
IF A2 =>36000 but < 48000 then return A2*0.04
IF A2 =>48000 but < 60000 then return A2*0.05
IF A2 =>60000 return A2*0.06

Rob
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 40548699
=IF(A2<12000,0,MIN(0.06,(1+INT(A2/12000))/100)*A2)
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 40548704
Similar vain to Rory but using a lookup on a separate table of values:

=A2*VLOOKUP(A2,$A$3:$B$8,2)

With A3:B8 being:

-9999      0
12000      0.02
24000      0.03
36000      0.04
48000      0.05
60000      0.06

Thanks
Rob H
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:robmarr700
ID: 40548706
What would the full formula be? Also bear in mind the "A2*" element will not always be at the fixed intervals.

In the future they could be 0.1, 0.04, 0.37 (example)
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 40548715
What I posted would be the full formula.

The range A3:B8 would be set elsewhere in your workbook, I merely used it on a blank sheet. When the required values change, you would just change them in the table rather than having to adjust all formulas.

The lookup formula normally has four parameters:
1) Lookup Value - what you are looking for
2) Lookup Range - the range that you are looking in
3) Offset Value - the column that has the result you want
4) Lookup type - False will try to find an exact match, True or omitted (as I have done) will find an approximate match that is not greater than the lookup value, eg 12500 would stop at 12000 as next option is 24000 so is greater than lookup value.

Copied down the reference to A2 will change but the reference to the table won't as I have made it an absolute reference.

Thanks
Rob H
0
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 250 total points
ID: 40548732
If 0 is the lowest number you'll have:

=A2*LOOKUP(A2,{0,12000,24000,36000,48000,60000},{0,0.02,0.03,0.04,0.050.06})

but I would agree that putting the values into a range would make maintenance simpler as you can just alter the lookup table and all your formulas will follow automatically.
0
 
LVL 32

Accepted Solution

by:
Rob Henson earned 250 total points
ID: 40548792
Rob,

Just for clarity; your original question says:

I'm intending on copying the formula down for all values in column 2
The current formula refers to column A which is column 1. Can you clarify what you are planning to do for other values? If it should be column 2 or B, then simply change the formula to:

=B2*VLOOKUP(B2,$A$3:$B$8,2)

Then copy down in whichever column you are putting this.

Thanks
Rob H
0
 
LVL 7

Expert Comment

by:Katie Pierce
ID: 40549189
=IF(A2<12000,A2*0,IF(A2<24000,A2*0.02,IF(A2<36000,A2*0.03,IF(A2<48000,A2*0.04,IF(A2<6000,A2*0.05,A2*0.06)))))
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tags from access to excel 3 26
splitting text of cell to columns 14 24
sql server query from excel 3 57
ADD New Entries 7 15
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now