+ Reply to Thread
Results 1 to 14 of 14

Sum of Order Total Based on Unique Order ID

Hybrid View

  1. #1
    Registered User
    Join Date
    07-31-2015
    Location
    Detroit
    MS-Off Ver
    2013
    Posts
    8

    Sum of Order Total Based on Unique Order ID

    Hello,

    I'm trying to get the sum of a Column B based on the unique values in Column A. For example, column B has order totals and column A has the order IDs. Below is example of data from my spreadsheet. A couple things to note: 1) there's not always a pre-defined number of rows. 2) Order IDs are not always known so the function cannot specify the unique order IDs.

    I'm sure there's a way to do this, but cannot seem to figure it out. I've tried pivot tables but it's just giving the total sum of Order Total, instead of the Order Total based on unique Order IDs. This would be easy to do in a database, but I need an Excel solution. Any help is appreciated!

    Order Id Order Total
    3203768 9.95
    3203769 98.95
    3203770 125
    3203771 63.12
    3203771 63.12
    3203772 164.95
    3203773 101.7
    3203774 67.04
    3203774 67.04
    3203774 67.04
    3203775 29.95
    3203776 119.99
    3203777 178.95
    3203778 99.95
    3203779 79.16
    3203781 248.95
    3203782 164.95
    3203783 498.95
    3203784 79.95
    3203785 94.32
    3203785 94.32

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Sum of Order Total Based on Unique Order ID

    Hi there. Like this, maybe??
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 07-31-2015 at 07:26 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Sum of Order Total Based on Unique Order ID

    You can do that using Pivot Tables..

    Put the OrderID in the Rows Area & Order Total In the Values Area..
    Cheers!
    Deep Dave

  4. #4
    Registered User
    Join Date
    07-31-2015
    Location
    Detroit
    MS-Off Ver
    2013
    Posts
    8

    Re: Sum of Order Total Based on Unique Order ID

    Thanks for the response. I did try that but it doesn't sum the values for only the unique orders. For example, order ID 3203771 has an order total of 63.12 but in the pivot table the order total is summed as 126.24.

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Sum of Order Total Based on Unique Order ID

    Can you attach a sample file, to see what is going wrong?

  6. #6
    Registered User
    Join Date
    07-31-2015
    Location
    Detroit
    MS-Off Ver
    2013
    Posts
    8

    Re: Sum of Order Total Based on Unique Order ID

    Thanks for the response Glenn. Column E in your spreadsheet does get the unique order IDs, but the sum isn't based off the unique order IDs. For example, order ID 3203771 has an order total of 63.12 but in column F the order total is summed as 126.24.

  7. #7
    Registered User
    Join Date
    07-31-2015
    Location
    Detroit
    MS-Off Ver
    2013
    Posts
    8

    Re: Sum of Order Total Based on Unique Order ID

    Looks like I made a duplicate post (I kept getting errors when trying to post originally). Sorry about that! Not sure if there's a way to mark something as duplicate and point to only one?

  8. #8
    Registered User
    Join Date
    07-31-2015
    Location
    Detroit
    MS-Off Ver
    2013
    Posts
    8

    Re: Sum of Order Total Based on Unique Order ID

    order-totals-need-unique.xlsx
    Here's an example file.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Sum of Order Total Based on Unique Order ID

    Sorry, I misread your post. Try this one instead:

    =IF(E2="","",INDEX($B$1:$B$100,MATCH(E2,$A$1:$A$100,0)))

  10. #10
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Sum of Order Total Based on Unique Order ID

    It is right!

    3203771 has 2 entries of 63.12 (Rows 5 & 6).. 63.12+63.12 = 126.24, which is being shown on the Pivot Table..

  11. #11
    Registered User
    Join Date
    07-31-2015
    Location
    Detroit
    MS-Off Ver
    2013
    Posts
    8
    Quote Originally Posted by NeedForExcel View Post
    It is right!

    3203771 has 2 entries of 63.12 (Rows 5 & 6).. 63.12+63.12 = 126.24, which is being shown on the Pivot Table..
    Apologies if I'm not being clear. 3203771 is listed twice because that order happened to have two items in the order with a total of 63.12. The unique total for this order is 63.12 but it's being listed twice. Summing the order totals I this way still includes duplicate order IDs but I need the order totals of all unique order IDs.

  12. #12
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Sum of Order Total Based on Unique Order ID

    Try this-

    Right Click on the Pivot Table (Average of Order Total) Columns > Summarize Values By > Average..

    Does this work for you?

  13. #13
    Registered User
    Join Date
    07-31-2015
    Location
    Detroit
    MS-Off Ver
    2013
    Posts
    8

    Re: Sum of Order Total Based on Unique Order ID

    Awesome, that seems to have done it! I tried it with another order that was listed 7x with an order total of 1,099.75 (not in the example data set I provided) and it's summing the orders correctly.
    I knew it'd be something simple! thanks!!

  14. #14
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Sum of Order Total Based on Unique Order ID

    No Problem!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] Highlight cell based on total quantity value based on repeated order numbers
    By PWilson0727 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2014, 02:02 PM
  2. [SOLVED] Order Form to Summarise Order on another sheet with a Submit Order Button
    By KazzICC in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-01-2014, 03:25 AM
  3. [SOLVED] Find Unique & calculate the Total of Work order
    By abaumgartner in forum Excel General
    Replies: 14
    Last Post: 08-02-2014, 02:38 PM
  4. [SOLVED] Quantity in column D based on order amount of times the order no appears
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-19-2013, 06:48 PM
  5. Replies: 5
    Last Post: 07-22-2013, 05:56 PM
  6. [SOLVED] Probably a SUM formula for order no. to get the total amount of order
    By Konnie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2013, 04:29 AM

Tags for this Thread

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