+ Reply to Thread
Results 1 to 12 of 12

Formula to summarize data

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Formula to summarize data

    Hello:

    Please refer to attached file.

    Sheet1 has data.
    I need formula in Sheet2 to give Invoice total for each state and for each month.


    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: Formula to summarize data

    TRY:

    =SUMPRODUCT(--(Sheet1!$R$2:$R$8=Sheet2!$A2),--(Sheet1!$A$2:$A$8=Sheet2!B$1),(Sheet1!$H$2:$H$8)) sheet2 B2

    copy across and down

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to summarize data

    Quote Originally Posted by JohnTopley View Post

    =SUMPRODUCT(--(Sheet1!$R$2:$R$8=Sheet2!$A2),--(Sheet1!$A$2:$A$8=Sheet2!B$1),(Sheet1!$H$2:$H$8)) sheet2 B2
    Here's the SUMIFS version...

    =SUMIFS(Sheet1!$H$2:$H$8,Sheet1!$R$2:$R$8,Sheet2!$A2,Sheet1!$A$2:$A$8,Sheet2!B$1)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Formula to summarize data

    Hi John:

    I am using on my workbook with the following formula but it giving #Name? error.
    Can you please check to see if there is any error:


    =SUMPRODUCT(--(Invoice detail!$R$2:$R$22627=Riz!$A2),--(Invoice detail!$A$2:$A$22627=Riz!B$1),(Invoice detail!$H$2:$H$22627))

    Thanks

    Riz

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to summarize data

    With a pivot table.

    See the attahced file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Formula to summarize data

    Since your sheet name contains a space the name should be enclosed in single inverted commas. It's always good practice anyway even if there are no spaces since if the sheet name is ever changed to one with a space the formula will continue to work.
    i.e.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However Tony's suggestion of using SUMIFS is IMO preferable. Sumproduct is somewhat old hat these days and was usually just a work around for Excel 2003 & prior.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to summarize data

    Quote Originally Posted by rizmomin View Post
    =SUMPRODUCT(--(Invoice detail!$R$2:$R$22627=Riz!$A2),--(Invoice detail!$A$2:$A$22627=Riz!B$1),(Invoice detail!$H$2:$H$22627))
    Like this...

    =SUMIFS('Invoice detail'!$H$2:$H$22627,'Invoice detail'!$R$2:$R$22627,Riz!$A2,'Invoice detail'!$A$2:$A$22627,Riz!B$1)

  8. #8
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Formula to summarize data

    Hi Guys:

    Now it worked after adding ' ' aroung Invoice detail.
    Would it be possible to have H a variable which i can have at lets say in cell N1.
    So basically i have lots of column and i will have dropdown list at cell N1 to select which column to evaluate.
    Please let me know if you have any questions.
    Thanks.

    Riz

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to summarize data

    How about this...

    Have a drop down list in cell N1 that has the column headers from the Invoice detail sheet range B1:L1 as the selections.

    Then, the formula would be...

    =SUMIFS(INDEX('Invoice detail'!$B$2:$L$22627,0,MATCH($N$1,'Invoice detail'!$B$1:$L$1,0)),'Invoice detail'!$R$2:$R$22627,Riz!$A2,'Invoice detail'!$A$2:$A$22627,Riz!B$1)

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to summarize data

    if you use the solution of a pivot table (#5) you don't have to change the month, since all months are available.

    See my example in #5.

  11. #11
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Formula to summarize data

    Hi Guys:

    All of you had great solutions and i will use them.
    Thanks a lot for great help.
    Riz

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to summarize data

    You're welcome. We appreciate the feedback!

+ 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] Formula to summarize
    By rizmomin in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 07-20-2014, 10:28 AM
  2. Formula to summarize two sets of detailed data
    By jvree75 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-17-2012, 10:20 AM
  3. Summarize variable data based on formula
    By Ricker090 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2012, 11:07 AM
  4. Formula to Summarize Data?
    By 2709236 in forum Excel General
    Replies: 11
    Last Post: 01-28-2011, 10:47 AM
  5. Need help creating a formula to summarize data!
    By Dorn in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-11-2005, 04:25 PM

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