+ Reply to Thread
Results 1 to 6 of 6

Calculate cumulative total based on given number in cell

  1. #1
    Registered User
    Join Date
    06-25-2010
    Location
    california
    MS-Off Ver
    Excel 2003
    Posts
    6

    Calculate cumulative total based on given number in cell

    Need help figuring out a cumulative formula base on a given number in a cell. If you look below, column A represents the range # of dogs and column B represents the price in that tier.


    range price
    1 to 5 @ $10
    6 to 10 @ $5
    11 to 20 @ $3

    So if a customer decides to buy 12 dogs the total price would be $81 = (5 dogs * $10)+(5 dogs*$5)+(2 dogs *$3)

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Calculate cumulative total based on given number in cell

    Hi,

    If you put the top number from the range into A2,A3,A4 and the prices in B2,B3,B4, with the number of dogs in A6, then put this in the cell where you want the result:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Here's a file with it working: Cumulative total _ for channguyen.xlsx
    On the second sheet, I've done it with named ranges, as that might make it easier to understand what's going on. That reads like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Hope that does what you want.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Registered User
    Join Date
    06-25-2010
    Location
    california
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Calculate cumulative total based on given number in cell

    Thanks Aardigspook.

    would there be a way to simplify the formula? I have about 20 pricing tiers, so using the IF formula to do this will be pretty long

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Calculate cumulative total based on given number in cell

    One way would be to create a pricing chart with the cumulative prices pre-calculated. This table could then be used with Vlookup to return the price for the number of dogs. This would allow you to easily change the prices.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    M
    N
    1
    Dogs Price
    2
    1
    10
    3
    2
    20
    4
    3
    30
    5
    4
    40
    6
    5
    50
    7
    6
    55
    8
    7
    60
    9
    8
    65
    10
    9
    70
    11
    10
    75
    12
    11
    78
    13
    12
    81
    14
    13
    84
    15
    14
    87
    16
    15
    90
    17
    16
    93
    18
    17
    96
    19
    18
    99
    20
    19
    102
    21
    20
    105


    If you use the max price for each sales level then this will work.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by newdoverman; 10-01-2015 at 06:37 PM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Calculate cumulative total based on given number in cell

    Try this...
    A
    B
    1
    5
    10
    2
    10
    5
    3
    20
    3
    4
    5
    12
    81

    B5=SUM(A5*3,IF(A5>$A$2,$A$2,$A$5)*2,IF(A5>$A$1,$A$1,A5)*5)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Calculate cumulative total based on given number in cell

    Perhaps with structured data you could use multi-tier calculation with sumproduct?

    Alf
    Attached Files Attached Files

+ 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. formula to calculate growth to required cumulative total
    By domski1974 in forum Excel General
    Replies: 12
    Last Post: 04-06-2022, 03:47 PM
  2. [SOLVED] Cumulative total formula based on number of occurrences
    By dma1976 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-17-2014, 10:35 AM
  3. Calculate implied CAGR from group of total (cumulative) cash flows.
    By heski2 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-17-2014, 09:43 PM
  4. Calculate total based on one cell value against another
    By mdshotgun in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-30-2013, 07:37 AM
  5. [SOLVED] Cumulative total based on month selection
    By pauldaddyadams in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-05-2013, 10:15 AM
  6. Replies: 6
    Last Post: 04-10-2011, 01:34 PM
  7. Replies: 0
    Last Post: 08-29-2005, 11:04 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