February 23, 2023
How to sum a value when there is a variable rate with a variable value. Example: 0 to 400 the rate is 0.02314, then their is 400 to 500 the rate is 0.03333, and lastly there is 500 to 600 and the rate is 0.04569. I am a newbie at Excel so please be kind and explain the answer is simple terms. Thanks
Trusted Members
February 13, 2021
There are a couple of ways to go about this, a nested IF or IFS, but I would recommend a VLOOKUP. You would simply put the formula =VLOOKUP(value,tblLookup,2,TRUE), where "value" is the value you want to find the rate for, and "tblLookup" is a separate table you created with the low end of your rates (0,400,500), the most important this is the "TRUE" which finds an approximate match. What that means is it will go down the list and find where the value is higher than your value and jump back down and use that rate. For example, if you have a value of 304, VLOOKUP will go down your lookup table find 400 and jump back down to 0 and use a rate of 0.02314.ย
I hope I'm making sense, find an example attached. ๐
February 23, 2023
Phil, thank you for replying. I will now attach a super simple workbook. If you look at the TEMPLATE sheet you will see that there is a 3 tier calculation of how they will charge me for my electric bill. Tier 1 is at the lowest rate and it goes up from there. Tier one level is 0 to 400 and T2 is 400 to 500 and T3 is 500 up. I am trying to calculate in the spreadsheet what the dollar amount will come to. See attachment. Remember I am not very well versed in using Excel. Worse than a novice. I make spreadsheets out of necessity.
October 5, 2010
Hi John,
Jessica's approach is the way to go.ย Because you have a rate that changes based on (presumably) the Kwh you use, you can use VLOOKUP to get the rate that is chargeable for each amount of Used Kwh.
In the attached workbook I've added a sheet called Example and added in the VLOOKUP formula into the Daily Cost column.ย The VLOOKUP uses cells on your Template sheet to lookup the data it needs - I've colored these yellow.
You'll see for the last 2 dates, where it's used 420 and 521 Kwh, the rate being charged is correct for that usage.ย For all other amounts of Used Kwh, it's working out the cost for Tier 1 because all amounts are below 100.
If you are not familiar with VLOOKUP this article explains how VLOOKUP works.
Regards
Phil
Answers Post
February 23, 2023
Phil just want to let you know that I have tried to adapt you file you supplied me and made some adjustment. I have attached my new file in which I used the suggested formulas. Seems to work great. Can't thank you and Jessica enough. I will continue to modify the file as need. And I just want to tell Jessica Stewart that it just took me a little bit longer with a few more trial and error steps to figure out just what you were telling me and how the formulas work. Still having a struggle to modify the Vllookup to work to my advantage. I will keep at it. Takes me just a little longer to learn. I am not the sharpest tool in the shed when it comes to using Excel.
ย
A big shout out to Jessica Stewart, THANK YOU.
I have attached my new workbook for all to see. I am not a pro and it may seem lame, but it works for me.
October 5, 2010
Hi John,
Well done getting it working.ย It's all about keeping at it and learning, whatever your pace.
If you get stuck then you can search through all of our blog posts to se if there's an article that explains what you need.
Or you can post a new question here.
regards
Phil
1 Guest(s)