+ Reply to Thread
Results 1 to 16 of 16

Calculate Base Value for Sliding Scale

  1. #1
    Registered User
    Join Date
    01-07-2012
    Location
    Washington DC, USA
    MS-Off Ver
    Excel 365
    Posts
    33

    Calculate Base Value for Sliding Scale

    I have a scenario where there is a sliding scale. If this was a commission I could figure it out based on the initial value using an approximate VLOOKUP. This specific situation is a fee. Say $20 order gets a $4 fee but a $70 gets $9.

    Setting up a spreadsheet to take a base and give me the final amount is easy. How can I take a final price and calculate the base price. So in the $70 example the total would be $79, how can I enter $79 and get it to tell me it's a $9 fee and $70 base?

    Happy to attach a spreadsheet with some example values if that helps.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2508 Win 11
    Posts
    24,959

    Re: Calculate Base Value for Sliding Scale

    Please attach sample
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    01-07-2012
    Location
    Washington DC, USA
    MS-Off Ver
    Excel 365
    Posts
    33

    Re: Calculate Base Value for Sliding Scale

    Okay should be added now. There will be scenarios where an end price isn't going to be possible due to the fee jumps. In the attached example at an $82 price point the base price would have to be $73.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,541

    Re: Calculate Base Value for Sliding Scale

    I don't see why an approximate match VLOOKUP() won't work here.

    1) Insert a column between E and F and enter the "final price" that corresponds to each fee jump. (=E2+G2 copied down).
    2) In B3, enter the lookup formula =VLOOKUP(A3,$F$2:$G$9,2,TRUE)
    3) In C3, subtract the fee from the final price =A3-B3.

    As far as I understand the problem, that seems to work. Is there something I am misunderstanding about the problem?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2508 Win 11
    Posts
    24,959

    Re: Calculate Base Value for Sliding Scale

    An alternative with Xlookup since you are running 365

    Excel 2016 (Windows) 64 bit
    A
    B
    C
    D
    E
    F
    1
    Base Price Fee
    2
    Final Price Fee Base
    $ -
    3
    =C3+B3
    =XLOOKUP(C3,E2:E9,F2:F9,"not found",-1)
    $ 65.00
    $ 20.00
    $ 1.00
    4
    $ 30.00
    $ 2.00
    5
    $ 40.00
    $ 3.00
    6
    $ 50.00
    $ 4.00
    7
    $ 60.00
    $ 5.00
    8
    $ 70.00
    $ 9.00
    9
    $ 80.00
    $ 12.00
    Sheet: Sheet1

  6. #6
    Registered User
    Join Date
    01-07-2012
    Location
    Washington DC, USA
    MS-Off Ver
    Excel 365
    Posts
    33

    Re: Calculate Base Value for Sliding Scale

    Quote Originally Posted by alansidman View Post
    An alternative with Xlookup since you are running 365

    Excel 2016 (Windows) 64 bit
    A
    B
    C
    D
    E
    F
    1
    Base Price Fee
    2
    Final Price Fee Base
    $ -
    3
    =C3+B3
    =XLOOKUP(C3,E2:E9,F2:F9,"not found",-1)
    $ 65.00
    $ 20.00
    $ 1.00
    4
    $ 30.00
    $ 2.00
    5
    $ 40.00
    $ 3.00
    6
    $ 50.00
    $ 4.00
    7
    $ 60.00
    $ 5.00
    8
    $ 70.00
    $ 9.00
    9
    $ 80.00
    $ 12.00
    Sheet: Sheet1
    Close but this is the reverse of what I was looking for. If I know the final price I want to calculate the base price. Your XLOOKUP the variable/input is the base price.

  7. #7
    Registered User
    Join Date
    01-07-2012
    Location
    Washington DC, USA
    MS-Off Ver
    Excel 365
    Posts
    33

    Re: Calculate Base Value for Sliding Scale

    Quote Originally Posted by MrShorty View Post
    I don't see why an approximate match VLOOKUP() won't work here.

    1) Insert a column between E and F and enter the "final price" that corresponds to each fee jump. (=E2+G2 copied down).
    2) In B3, enter the lookup formula =VLOOKUP(A3,$F$2:$G$9,2,TRUE)
    3) In C3, subtract the fee from the final price =A3-B3.

    As far as I understand the problem, that seems to work. Is there something I am misunderstanding about the problem?
    This is very close! However doesn't accurately account for the sliding scale.

    Example: Say I enter a final price of $75, in your example it calculates the fee at $5 and the base at $70, but a $70 base gets a $9 fee so the correct total would be $79 (same is true for the $71-$78 base prices).

    It's like it needs an AND criteria where it needs to match on both the base and the base + fee (column F that was added).

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,541

    Re: Calculate Base Value for Sliding Scale

    Would anyone ever enter 75 in as the final price? As I interpreted the problem, 75 would never be a valid final price, so one would never enter 75. Is that the real question, how to have the formula identify invalid entries? If that is what is needed, I would still use a lookup table, just add the "invalid" ranges to the lookup table (which probably means using separate lookup tables for the "base to final" and the "final to base" calculations).

    1) Lookup table:
    Please Login or Register  to view this content.
    2) Then the same lookup function in B3. If desired, you can add some kind of error trap to C3 so that you don't get an error value in C3 when B3 is "invalid" text.

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2508 Win 11
    Posts
    24,959

    Re: Calculate Base Value for Sliding Scale

    Maybe

    Excel 2016 (Windows) 64 bit
    A
    B
    C
    2
    Final Price Fee Base
    3
    $ 92.00
    =XLOOKUP(C3,E3:E9,F3:F9,,0)
    =XLOOKUP(A3,E2:E9,E2:E9,,-1)
    Sheet: Sheet1

  10. #10
    Forum Contributor
    Join Date
    02-12-2024
    Location
    Australia
    MS-Off Ver
    365
    Posts
    187

    Re: Calculate Base Value for Sliding Scale

    in B3; =MAX(IF(E2:E9+F2:F9<=A3,F2:F9,""))
    in c3 = A3-B3
    Last edited by Eeza Goodun; 07-02-2025 at 11:07 PM.

  11. #11
    Registered User
    Join Date
    01-07-2012
    Location
    Washington DC, USA
    MS-Off Ver
    Excel 365
    Posts
    33

    Re: Calculate Base Value for Sliding Scale

    I see what you're doing and like it but the math is working out. Example I put $67 in there it tells me the base price is $60 and the fee is $5 which doesn't add up to $67. If I add a helper cell that subtracts A3-B3 to get the true base, it works except in the ranges where certain numbers are not possible. Example: $71 as the final, it will give me a $9 fee and $70 base, which is clearly off. The correct math in that would be $66 base and $5 fee. Also some prices like $76 will never be possible.

  12. #12
    Registered User
    Join Date
    01-07-2012
    Location
    Washington DC, USA
    MS-Off Ver
    Excel 365
    Posts
    33

    Re: Calculate Base Value for Sliding Scale

    It almost works. Problem is on the changes. Example: A final price of $75 isn't possible, but it tells me that $75 would be a $5 fee and $70 base, but that the base of $70, then it's a $9 fee.

  13. #13
    Registered User
    Join Date
    01-07-2012
    Location
    Washington DC, USA
    MS-Off Ver
    Excel 365
    Posts
    33

    Re: Calculate Base Value for Sliding Scale

    You're correct $75 is an impossible price. I can do this math all day. My marketing colleagues are struggling with this. They keep picking prices, and I keep having to explain how the math works and I'm getting tired of having to do this for them. Sadly that means I have to simplify and be full proof.

    If I am following correctly, I'm just creating a new table with every possible integer. If that's the case I could just take those base numbers do the math (in another hidden sheet) and then just have B3 and C3 vlookup from the table with every integer.

  14. #14
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,541

    Re: Calculate Base Value for Sliding Scale

    If I am following correctly, I'm just creating a new table with every possible integer.
    If this is referring to my lookup table solution, I'm not envisioning an every possible integer lookup table (unless the calculations are much more complicated than is being represented and every possible integer is the easiest way to do it). You need enough entries to cover the "valid" and "invalid" ranges. If you look at the lookup table I started, you can see that the first entry in the table will cover all finals from 0.00 to 19.99.... The second "invalid" entry covers the invalid entries between 20.00 and 20.99.... And so on. You just need to identify the boundary values between valid and invalid final prices and put those in the lookup table.

  15. #15
    Registered User
    Join Date
    01-07-2012
    Location
    Washington DC, USA
    MS-Off Ver
    Excel 365
    Posts
    33

    Re: Calculate Base Value for Sliding Scale

    Your approach makes a lot of sense. Since I am dealing with a somewhat limited scope I don't mind a helper table of integers. I will likely fuss with it later and add a condition that if the value is clearly at the higher scale to just follow that. However as the scales do change and I'm making this for myself and another colleague at a different company I opted for the most dynamic solution.

    Using your approach (and thank you for the idea), I added another table in sheet2 (which will be hidden before sending around). I did some fussing with my formulas in B3 and C3 to ensure it could handle float numbers and not just integers.

    Ran the integer list up to 250 as we rarely go above it and frankly marketing doesn't usually touch those prices.
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    02-12-2024
    Location
    Australia
    MS-Off Ver
    365
    Posts
    187

    Re: Calculate Base Value for Sliding Scale

    Quote Originally Posted by rlpowers View Post
    I see what you're doing and like it but the math is working out. Example I put $67 in there it tells me the base price is $60 and the fee is $5 which doesn't add up to $67. If I add a helper cell that subtracts A3-B3 to get the true base, it works except in the ranges where certain numbers are not possible. Example: $71 as the final, it will give me a $9 fee and $70 base, which is clearly off. The correct math in that would be $66 base and $5 fee. Also some prices like $76 will never be possible.
    Rubbish. If you put $67 in using the formula in post#10 you get $62 for the base price and $5 fee which is correct according to your 'rules'.
    You don't need a helper cell.... A3-B3 is the formula for the Base price in C3!

    $71 as the final price using the formula provided in post #10 gives a fee of $5 and a base of $66. Again correct.

    You haven't told us how you want to handle the 'impossible' final prices. That would be handy.

    Read ALL the solutions provided before commenting.
    Last edited by Eeza Goodun; 07-03-2025 at 06:51 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to calculate progressive sliding scale commission
    By Wendy A in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-03-2020, 03:59 PM
  2. How to calculate and nonlinear sliding scale
    By ntomlin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-01-2015, 05:44 PM
  3. sliding scale?
    By GardenGrow in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 03-30-2014, 08:50 PM
  4. [SOLVED] sliding scale???
    By GardenGrow in forum Excel General
    Replies: 6
    Last Post: 03-29-2014, 01:15 PM
  5. [SOLVED] Formula to calculate commission based on sliding scale
    By Excel Dumbo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-31-2013, 10:52 PM
  6. Calculate Sliding Scale
    By CRC in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-27-2012, 12:39 AM
  7. can I calculate S&H on a sliding scale in an order form?
    By TNP in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-01-2005, 02:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1