+ Reply to Thread
Results 1 to 6 of 6

Subtotalling variable data

  1. #1
    Registered User
    Join Date
    05-20-2012
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2007
    Posts
    15

    Subtotalling variable data

    Hi there. In the attached sheet I am trying to return a Total in cell H5 (sheet 2) based on the following steps:
    1. Calculate no. of units in sheet 1, column L where ("£1.25" = 1 unit and "£2.50" = 2 units)
    2. Subtract units where there is a value in sheet 1, column M greater than zero. For example, row 13 in sheet 1 would total 1 unit ("£1.25" in L13 = 1 unit and there's nothing above zero in M13); row 20 would total 2 units using the same logic; but row 35 would be zero units as M35 = >0.
    3. Add the whole lot together to return my Total in sheet 2, H5.

    The problem I'm having is with getting it to subtract the appropriate number of units when it sees a value above zero in column M - i.e. subtract 1 unit when L*=£1.25 but subtract 2 units when L*=£2.50.

    Any help would be appreciated.

    ThanksSample customer spreadsheet.xls

  2. #2
    Registered User
    Join Date
    08-27-2012
    Location
    Saldanha, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Subtotalling variable data

    So in row 35 it should subtract one unit from the eggs even though there is a 2? The way you use your "Holiday this wk?" column is unclear. It could aid in the solution if better understood.

  3. #3
    Registered User
    Join Date
    05-20-2012
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Subtotalling variable data

    Hi Bongaan, sorry for the confusion. The characters in Column M have no significance (well they do have significance, but for a purpose unrelated to this thread). Basically, if any number above zero appears in Column M, whatever it is, for these purposes it just means the same thing - the customer is on holiday so does not want their eggs. What I'm trying to get Excel to recognise in the totalling is that, if column L is £2.50, the customer buys 2 boxes of eggs; if column L is £1.25, the customer buys 1 box of eggs. If anything appears in column M (showing that the customer is on holiday), I want Excel to subtract the correct number of boxes (1 or 2) from the total in cell H5 (sheet 2). Does that make sense? Thanks!

  4. #4
    Registered User
    Join Date
    08-27-2012
    Location
    Saldanha, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Subtotalling variable data

    Thanks, now better understood, this should do it: =SUMIFS('Sheet 1'!L:L,'Sheet 1'!M:M,"",'Sheet 1'!S:S,"")/1.25

    the formula reads: Sum those egg prices in L which have no value in M (Customer not on holiday) and which also have no value in S (customer haven't left).

  5. #5
    Registered User
    Join Date
    05-20-2012
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Subtotalling variable data

    Great solution, thanks! Just one remaining question if you don't mind my ignorance. If I want to filter Sheet 1 (in this case using Column P to filter only by customers due a delivery this week), how do I get the calculation in sheet 2 cell H5 to be based just on the visible rows? Thanks once again for your help.

  6. #6
    Registered User
    Join Date
    08-27-2012
    Location
    Saldanha, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Subtotalling variable data

    It's unfortunately only the subtotal function that "take note" of filtered results, so you will have to combine subtotal and sumif somehow. There is a solution to that, but unfortunately not in my league. Google "sumif and subtotal". I unfortunately do not have the time now to figure it out myself, sorry.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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