+ Reply to Thread
Results 1 to 11 of 11

Counting Products Sold Per Rep

  1. #1
    Registered User
    Join Date
    08-22-2008
    Location
    Michigan
    Posts
    71

    Counting Products Sold Per Rep

    I'm trying to write a formula to count under certain conditions. I tried the following (and some other variations), but it doesn't work, it comes back #VALUE!:

    =COUNTIFS('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$10:$K$100,D7,'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$A:$A,A34)

    I need to count the number of products a rep sold in one day. He can have several sales in one day, and also sell more than one product per sale. The list I am pulling from has all sales from all reps for the day.

    Any suggestions on how to make this work?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    If COUNTIFS() in 2007 is like COUNTIF() in 2003, then it won't work referencing closed workbooks... You will have to resort to SUMPRODUCT()

    Please Login or Register  to view this content.
    Note: You also had different range sizes... they must be the same sizes...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-22-2008
    Location
    Michigan
    Posts
    71
    Thanks! I wasn't familar with SUMPRODUCT. I had to modify it to encompass all the product fields, and then I put it into an IF funtion so that if they didn't sell anything it'll return a blank result. It looks really long and gaudy, but it works!

    =IF(SUMPRODUCT((--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$10:$K$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$7)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$10:$K$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$9)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$6)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$7)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$8)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$9)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$6)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$7)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$8)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$9)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$10:$N$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$6)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$10:$N$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$7)),--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$A$10:$A$100=A34))=0,"",SUMPRODUCT((--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$10:$K$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$7)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$10:$K$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$9)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$6)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$7)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$8)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$9)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$6)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$7)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$8)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$9)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$10:$N$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$6)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$10:$N$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$7)),--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$A$10:$A$100=A34)))

    Any suggestions on how to shorten it up? If not, at least it works.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I think in Excel 2007, you can use the IFERROR() function to trap errors and this eliminates having to repeat the arguments twice..

    Try perhaps:

    Please Login or Register  to view this content.
    I can't test it because I don't have 2007 and the formula is too long for 2003 to handle.

  5. #5
    Registered User
    Join Date
    08-22-2008
    Location
    Michigan
    Posts
    71
    I tried it, but I get an error that points to the area between the smiley's, and I can't get past that.

    =IFERROR(SUMPRODUCT(--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$10:$K$100={'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$7),'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$9)}),--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100={'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$6),'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$7),'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$8),'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$9)},--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100={'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$6),'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$7),'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$8),'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$9)}--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$10:$N$100={'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$6),'[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$7}),--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$A$10:$A$100=A34))),"")

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Yeah, you're correct it won;t work.. you can't put cell references in arrays...

    Well you can still use the IFERROR with your original and take out half of the formula...

  7. #7
    Registered User
    Join Date
    08-22-2008
    Location
    Michigan
    Posts
    71
    That works, but then if they didn't sell anything, it returns 0 instead of leaving the cell blank.

    Does that mean I have to stick with my gaudy formula?

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    did you put a null (i.e. "") as the 2nd argument in the formula.. it should work... but then again, I don't have 2007 to prove it.

  9. #9
    Registered User
    Join Date
    08-22-2008
    Location
    Michigan
    Posts
    71
    Yes, but it still comes back as 0.

    =IFERROR(SUMPRODUCT((--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$10:$K$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$7)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$10:$K$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$K$9)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$6)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$7)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$8)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$10:$L$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$L$9)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$6)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$7)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$8)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$10:$M$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$M$9)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$10:$N$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$6)--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$10:$N$100='[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$N$7)),--('[Compliance 20080804 Friday.xlsx]Compliance and Interview Log'!$A$10:$A$100=A23)),"")

    Did I enter something wrong?

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    It/s kind of hard to diagnose since I can't work with a formula that big in 2003...

    but try:

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    08-22-2008
    Location
    Michigan
    Posts
    71
    It still comes back as 0. I guess I'll just stick with the long formula.

    Thanks for all of your help!

+ 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. array formulas to determine cost of goods sold
    By jennyp6606 in forum Excel General
    Replies: 2
    Last Post: 03-05-2008, 05:58 PM
  2. Complex Array Formulas for cost of goods sold valuation
    By jennyp6606 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2008, 08:22 AM
  3. Replies: 1
    Last Post: 12-15-2007, 02:34 AM
  4. Counting products delivered by month
    By gdi2k in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-25-2007, 08:50 AM
  5. extract all the products mentioned in a column
    By saadeet in forum Excel General
    Replies: 5
    Last Post: 03-03-2007, 03:00 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