+ Reply to Thread
Results 1 to 12 of 12

Attempting to count number of items per transiction

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    US
    MS-Off Ver
    Office 2010
    Posts
    27

    Attempting to count number of items per transiction

    I am attempting to calculate something, and it is based on an ever-growing horizontal list.

    The list of supply item goes vertically, then each time I order supplies, it is listed in 2 new columns.

    What I can not figure out is how to count the number of items from each vendor. Currently, I select each cell, each time. =F20+J20+T20+X20+AH20+AN20+AP20+AT20+AX20+AZ20+BB20+BD20

    A better way has to exist. I researched pivot tables, but it appears they need a set area, and as this table keeps growing each week, I couldn't figure out how to do it.

    I would think I could then use this same formula to be used on the header to count order per month.

    Thanks

    File is attached
    Attached Files Attached Files
    Last edited by AliGW; 05-21-2019 at 08:40 AM.

  2. #2
    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,917

    Re: Help with countifs

    Try this...
    =SUMIF($D$19:$LJ$19,T$6,E$20:LK$20)
    (this is for ZOLL
    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

  3. #3
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,215

    Re: Help with countifs

    In "U7" =SUMPRODUCT(($D$19:$LJ$19=T$6)*(E$20:LK$20))


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,337

    Re: Help with countifs

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    04-09-2013
    Location
    US
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: Help with countifs

    requested cahanges made

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,337

    Re: attempting to count number of items per transiction

    Much better - thank you.

  7. #7
    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,917

    Re: attempting to count number of items per transiction

    @ Ali, thanks for the check, I got so into the question I got side tracked from the title.

    @ traveler911, did you try either of the suggestions made?

  8. #8
    Registered User
    Join Date
    04-09-2013
    Location
    US
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: attempting to count number of items per transiction

    I did, they helped with one section, but it did not work with counting transactions.

    T7 would be an example.

    Any ideas on a variation of the sumproduct?

  9. #9
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: attempting to count number of items per transiction

    For formulas like those offered so far, there needs to be naming consistency. For example
    Z6: GCH - Pharmacy
    H19: GCH - Pharm

    Here is a derivative of Ford's formula that can be entered in N7 and copied across, without change, to AC7:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    For testing purposes I put the formula in row-8 and compared column by column with your original values. They matched except for GHC-Pharmacy for the reason noted above and T7 for ZOLL where I think your T7 formula is incorrect.

    Let us know if this helps and if it solves your original problem.

  10. #10
    Registered User
    Join Date
    04-09-2013
    Location
    US
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: attempting to count number of items per transiction

    That worked perfectly.

    Can you please explain the why M$6 on the last set of SUMIF's? M$6 is an empty field, so I don't understand what it is referencing.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,337

    Re: Attempting to count number of items per transiction

    When you are ready, please select Thread Tools from the menu link above and mark this thread as SOLVED. Please don't edit the thread title to mark the thread as such. Thanks.

  12. #12
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Attempting to count number of items per transiction

    You're right, M$6 is an empty cell. However, as the N6 formula is copied to the right you will see that the M$6 reference becomes N$6, O$6, P$6 etc. The formula starts off with a check of whether the column number is even or odd. Column-N is an even column, so in fact the last set of SUMIF's (and hence M$6) is not evaluated/used by the formula in cell N6.

    Now look at the formula in cell O6 - the reference is to N6 which contains "Arrow" which is the criterion we need for the last (second) set of SUMIF's which is what is used by the formula in O6 because col-O is odd.

    In summary, the formula does different things on alternate columns - this helps maintainability by giving you a single formula that you can copy across all columns but at the cost of added complexity.

    Hopefully the above explanation is clear - if you still have questions let me know - and thanks for the added reputation points

+ 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. Replies: 6
    Last Post: 03-19-2019, 09:14 PM
  2. [SOLVED] Sumproduct to replace countifs as countifs don't work on external source reference
    By KrishnaSagar in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-02-2017, 02:33 AM
  3. How can I run CountIfs + CountIfs without double counting?
    By hiitsjessie in forum Excel General
    Replies: 1
    Last Post: 02-06-2017, 04:49 PM
  4. [SOLVED] Countifs + Countifs - replacement?
    By JulieQ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-05-2015, 03:02 PM
  5. COUNTIFS OR COUNTIFS needs to work
    By joshbellfi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-23-2013, 10:55 AM
  6. COUNTIFS OR...multiple countifs without duplication in the numbers
    By HooligaD in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2012, 09:53 AM
  7. Replies: 0
    Last Post: 12-16-2011, 09:01 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