+ Reply to Thread
Results 1 to 11 of 11

count off table

  1. #1
    Forum Contributor
    Join Date
    09-30-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    266

    count off table

    Hi
    I need to figure out the following formulas in the attached template. In quarter 1, column ref A i would like to do a count based on the table of the person who has the most items found in cell G4, the total value of the items to that person in cell H4 and the number of items (each line item is one count) in cell I4. I've put up an expexted results table for easier reference.
    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,206

    Re: count off table

    "Helper" in E

    in E2

    =IF(A2=LEFT($H$2)&RIGHT($H$2),IF(COUNTIFS($D$2:D2,D2)=1,COUNTIFS($A$2:$A$16,"q1",$D$2:$D$16,D2)+ROW()*10^-3,""),"")

    copy down

    in G4

    =IFERROR(INDEX($D$2:$D$16,MATCH(LARGE($E$2:$E$9,ROWS($1:1)),$E$2:$E$9,0)),"")

    in H4

    =SUMIFS($C$2:$C$16,D$2:D$16,$G4,$A$2:$A$16,LEFT($H$2)&RIGHT($H$2))

    in I4

    =COUNTIFS($D$2:$D$16,$G4,$A$2:$A$16,LEFT($H$2)&RIGHT($H$2))
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    09-30-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    266

    Re: count off table

    Hi John
    I realised that when i created a similar table in Q2, if there is a a same person listed in Q1, the results are not being extracted to the table in Q2 for example "John". I've attached the table. Able to assist?
    Attached Files Attached Files

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: count off table

    M5=IF(N5=0,"",INDEX($I:$I,SMALL(INDEX(((SUMIFS($H$3:$H$11,$I$3:$I$11,$I$3:$I$11,$C$3:$C$11,$N$3)<>$N5)+($C$3:$C$11<>$N$3))*10^10+ROW($I$3:$I$11),0),COUNTIF($N$5:$N5,$N5))))
    N5=LARGE(SUMIFS($H$3:$H$11,$I$3:$I$11,$I$3:$I$11,$C$3:$C$11,$N$3)*(ROW(I$3:I$11)=MATCH(I$3:I$11,I:I,0)),L5)
    O5=COUNTIFS($I$3:$I$1000,$M5,$C$3:$C$1000,$N$3)
    Try this and copy towards down

    See the attached file
    Attached Files Attached Files
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: count off table

    First Place Formula in N5 Then M5 and O5 and copy towards down

  6. #6
    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,206

    Re: count off table

    Siva's solution (easily amended I am sure) is based on highest value not highest number of items.
    the person who has the most items found in cell

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: count off table

    Sorry Jhon by overlooking I missed the Count
    see the attached file
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    09-30-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    266

    Re: count off table

    Hi Siva i get an #value when i extend the range in the formula from cells $11 till $1000 in column O. I do lock the arrays {} but seem to continue getting this error. Not sure where I am failing the formula.

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: count off table

    Changed the formula little bit - see the attached file
    Attached Files Attached Files

  10. #10
    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,206

    Re: count off table

    You can remove the problem by adding dynamic named ranges for "Quarter", "Value","Found_By" as below


    =OFFSET(Sheet1!$C$3,,,COUNTIF(Sheet1!$C$3:$C$1000,"?*"),1)

    =OFFSET(Sheet1!$H$3,,,COUNT(Sheet1!$H$3:$H$1000),1)

    =OFFSET(Sheet1!$I$3,,,COUNTIF(Sheet1!$I$3:$I$1000,"?*"),1)

    Change formulae:

    in N2

    =SUMIFS(Value,Found_by,$M19,Quarter,$L$17)

    in O2

    =IFERROR(LARGE(COUNTIFS(Found_by,Found_by,Quarter,$L$17)*(ROW(Found_by)=MATCH(Found_by,I:I,0)),L19),0)

    ..confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    in M2

    =IF(O19=0,"",INDEX($I:$I,SMALL(INDEX(((COUNTIFS(Found_by,Found_by,Quarter,$L$17)<>$O19)+(Quarter<>$L$17))*10^10+ROW(Found_by),0),COUNTIF($O$19:$O19,$O19))))

    .See Q2 table
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    09-30-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    266

    Re: count off table

    Thanks . this worked.

+ 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] Resize table to same row count as a piovt table
    By djon5020 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2014, 01:43 AM
  2. Replies: 1
    Last Post: 05-16-2014, 07:34 PM
  3. How to count distinct values from table in pivot table
    By gopijadhav in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-04-2014, 07:14 AM
  4. [SOLVED] Count formula not count hidden cells in table
    By tlacloche in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2013, 02:35 PM
  5. Replies: 0
    Last Post: 03-22-2012, 08:44 PM
  6. Replies: 2
    Last Post: 02-11-2012, 09:33 PM
  7. Replies: 5
    Last Post: 06-22-2010, 03:17 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