+ Reply to Thread
Results 1 to 6 of 6

Sum data by column and row "NAME"

  1. #1
    Registered User
    Join Date
    03-22-2013
    Location
    home, away from home
    MS-Off Ver
    Excel 2010
    Posts
    3

    Sum data by column and row "NAME"

    (MS Excel 2010)

    I have reports that fluctuate column and row data location. Today, the column of "TOY01" was in [P] , the day before when I received the report, the column of "TOY01" was in [S]. The corresponding row to the column is also changing, in most cases multiple rows as well. Example:

    A B C D
    1 TOY01 TOY02 TOY03
    2 TOM 1 0 0
    3 BILL 0 1 0
    2 TOM 1 0 0
    3 BILL 0 1 0

    I'd like is to see that Tom sold 2 "TOY01", and Bill sold 2 "TOY02", knowing that the different columns for the different "TOY" types will will most likely be different on the next report. And one last detail, pivots are not an option, let me know if any more details are needed. Thanks!
    Last edited by HadouKevin; 03-22-2013 at 04:14 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Sum data by column and row "NAME"

    you could try like this using
    offset and match for example
    =SUMIF(rawdata!$A$2:$A$1000,$A2,OFFSET(rawdata!$A$1,1,MATCH(B$1,rawdata!$B$1:$AA$1,0),COUNTA(rawdata!$A$1:$A$1000)))
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    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
    52,936

    Re: Sum data by column and row "NAME"

    dang Martin, and to think that 1 day, worms may be eating a brain like that
    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

  4. #4
    Registered User
    Join Date
    03-22-2013
    Location
    home, away from home
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Sum data by column and row "NAME"

    Wow; going to need some time to absorb this....thank you for the response. Looks great!

  5. #5
    Registered User
    Join Date
    03-22-2013
    Location
    home, away from home
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Sum data by column and row "NAME"

    This works as requested, thanks again!

    I am however very interested in the "why" this works If you don't mind. The "OFFSET" is very much giving me wrinkles.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Sum data by column and row "NAME"

    offset can be used to create a range at its simplest
    =OFFSET(A1,1,1) is equal to b2 ie 1 cell down(row) one across(column) from A1
    but there are options to make it a range by increasing the number of rows or columns
    =OFFSET(A1,1,1,10)
    refers to the range b2:b11 ie start 1 row down and one column across from a1 ie b2 and include 10 rows
    =OFFSET(A1,1,1,,10) does the same but starts at b2 and goes across 10 columns
    creating b2:k2
    then you can include a whole range by specifying rows and columns
    eg =OFFSET(A1,1,1,10,5)
    = b2:f5
    when used as a range on its own it shows #VALUE!
    in the cell
    but can be used in other calculations like
    =sum(OFFSET(A1,1,1,10,5)) that will ad up every thing in b2:f5
    the COUNTA(rawdata!$A$1:$A$1000) bit i included just counts how many cells in the column a1:a1000 are used to make the number of rows dynamic you could just put 100 or 1000 or however many you are likely to have

+ 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