+ Reply to Thread
Results 1 to 9 of 9

add new criteria to formula

  1. #1
    Registered User
    Join Date
    03-23-2015
    Location
    us
    MS-Off Ver
    365
    Posts
    93

    add new criteria to formula

    Original formula: Count unique dates in A:A
    =SUMPRODUCT(1/COUNTIF($A$6:INDEX($A:$A,MATCH(1E+100,$A:$A)),$A$6:INDEX($A:$A,MATCH(1E+100,$A:$A))))

    I need to add the criteria; Count the number of unique dates in A:A where I:I=2
    If I:I=2, then =SUMPRODUCT(1/COUNTIF($A$6:INDEX($A:$A,MATCH(1E+100,$A:$A)),$A$6:INDEX($A:$A,MATCH(1E+100,$A:$A))))

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: add new criteria to formula

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    i.e. this will replace 1 in the numerator.
    ($I$6:INDEX($I:$I,MATCH(1E+100,$I:$I))=2)
    Dave

  3. #3
    Registered User
    Join Date
    03-23-2015
    Location
    us
    MS-Off Ver
    365
    Posts
    93

    Re: add new criteria to formula

    Does not work. Get #N/A error.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: add new criteria to formula

    May we have a representative Excel workbook upload that is producing this error? (not a pic or screenshot ... saves retyping data)

    If you are not familiar with how to do this, (the paperclip icon does not work):

    To attach a file to your post: (Please no pics or screenshots ... saves retyping data.),
    • be sure to desensitize the data
    • click “Go Advanced” (next to Post Quick Reply – bottom right),
    • scroll down until you see “Manage Attachments”, click that,
    • click “Browse”.
    • select your file(s)
    • click “Upload”
    • click “Close window”
    • click “Submit Reply”

    The file name will appear at the bottom of your reply.

  5. #5
    Registered User
    Join Date
    03-23-2015
    Location
    us
    MS-Off Ver
    365
    Posts
    93

    Re: add new criteria to formula

    see attached sample
    See I1
    Attached Files Attached Files

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: add new criteria to formula

    Thanks for the upload skipro. Try this. The #N/A is gone. Is now 66.5
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Needed to change the column that defined the I:I range. It had blanks and text in what is mostly numeric. The rest of the formula is a guess at what the intent is.

    Does this help?

  7. #7
    Registered User
    Join Date
    03-23-2015
    Location
    us
    MS-Off Ver
    365
    Posts
    93

    Re: add new criteria to formula

    Does not give accurate figure. There should not be fractions. It also does not like it when the numbers in I are not continuous.
    Thanks.

  8. #8
    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
    80,715

    Re: add new criteria to formula

    You need to be specific: state two or three cells where the result is wrong and tell us what you think it should be. "Does not give accurate figures" is too vague.
    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.

  9. #9
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2019
    Posts
    197

    Re: add new criteria to formula

    Try...........

    In I1, array formula (Ctrl+Shift+Enter)

    =SUM(IFERROR(($I$6:INDEX($I:$I,MATCH(1E+100,$I:$I))=2)/COUNTIFS($A$6:INDEX($A:$A,MATCH(1E+100,$I:$I)),$A$6:INDEX($A:$A,MATCH(1E+100,$I:$I)),$I$6:INDEX($I:$I,MATCH(1E+100,$I:$I)),$I$6:INDEX($I:$I,MATCH(1E+100,$I:$I))),0))

    Regards
    Bosco

+ 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: 4
    Last Post: 04-14-2017, 05:14 PM
  2. [SOLVED] Index and Two Match Criteria- meeting both criteria (need help to repair formula)
    By OilAndGasMan1984 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2017, 10:56 PM
  3. Formula for summing on multiple row criteria and a dynamic column criteria
    By ianswilson815 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-25-2016, 01:58 PM
  4. Replies: 3
    Last Post: 04-21-2015, 07:45 AM
  5. Replies: 7
    Last Post: 07-07-2014, 09:48 AM
  6. [SOLVED] IF Formula returns #N/A even when criteria if criteria not met
    By Ellice16 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-11-2013, 10:51 PM
  7. Replies: 1
    Last Post: 05-16-2011, 05:00 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