+ Reply to Thread
Results 1 to 13 of 13

COUNTIF error

  1. #1
    Registered User
    Join Date
    01-05-2016
    Location
    D.C.
    MS-Off Ver
    Office 2016
    Posts
    29

    Question COUNTIF error

    All,

    I'm trying to get the input from this table

    Screen Shot 2016-02-04 at 9.16.41 AM.png

    to populate into this table if the "Date Out" (column 0) <= TODAY()+10. I'd like it to populate from earliest Date Out to latest.

    Screen Shot 2016-02-04 at 9.16.49 AM.png

    I'm using this formula, but it's returning the error "you've entered too few arguments..." Can someone please advise?

    =IF(ROWS($A$1:$A1)>COUNTIF($O$2:$O$1000<=TODAY()+10,"",INDEX($N$2:$N$1000,SMALL(INDEX(($O$2:$O$1000<=TODAY()+10)*(ROW($A$2:$A$1000)-ROW($A$2)+1),),COUNTA($N$2:$N$1000)+COUNTBLANK($N$2:$N$1000)-COUNTIF($O$2:$O$1000<=TODAY()+10+ROWS($A$1:$A2))))

    Thank you!!!

  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
    30,947

    Re: COUNTIF error

    Please post a sample Excel file rather than images.

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIF error

    Both occurances of
    COUNTIF($O$2:$O$1000<=TODAY()+10

    need to be changed to
    COUNTIF($O$2:$O$1000,"<="&TODAY()+10)

  4. #4
    Registered User
    Join Date
    01-05-2016
    Location
    D.C.
    MS-Off Ver
    Office 2016
    Posts
    29

    Re: COUNTIF error

    Jonmo,

    I tried your suggestion, but am still having no luck. Also, per JohnTopley's suggestion, I've attached an excel file.

    The formula isn't pasted into Column V yet, as excel won't accept it as a formula. Here's where I left off:

    =IF(ROWS($A$1:$A1)>COUNTIF($O$2:$O$1000"<="TODAY()+10,"",INDEX($N$2:$N$1000,SMALL(INDEX(($O$2:$O$1000<=TODAY()+10)*(ROW($A$2:$A$1000)-ROW($A$2)+1),),COUNTA($N$2:$N$1000)+COUNTBLANK($N$2:$N$1000)-COUNTIF($O$2:$O$1000"<="TODAY()+10+ROWS($A$1:$A2))))

    PTO_test.xlsx


    Thank you!!

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIF error

    Quote Originally Posted by shellataylor View Post
    Jonmo,

    I tried your suggestion
    Not quite. Your countif functions are still missing elements that I suggested.

    Quote Originally Posted by Jonmo1 View Post
    Both occurances of
    COUNTIF($O$2:$O$1000<=TODAY()+10

    need to be changed to
    COUNTIF($O$2:$O$1000,"<="&TODAY()+10)

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: COUNTIF error

    Try

    in U2
    =IFERROR(INDEX($N$2:$R$5,SMALL(IF($O$2:$O$5 < TODAY()+10,ROW(INDIRECT("1:"&ROWS($N$2:$N$5)))),ROW(N1)),COLUMN()-20),"")}
    Array formula, use Ctrl-Shift-Enter

    copy across to Y2
    then copy U2:Y2 down the columns
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  7. #7
    Registered User
    Join Date
    01-05-2016
    Location
    D.C.
    MS-Off Ver
    Office 2016
    Posts
    29

    Re: COUNTIF error

    Jonmo1 - Good point, I missed that. I added in the , & and ) as suggested. Now the formula returns nothing/blank cell. I've attached for your consideration.

    PTO_test.xlsx


    Special-K, I pasted your formula in and tried to apply the array...it doesn't seem to like the formula. I likely did something wrong

    Thanks!!

  8. #8
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: COUNTIF error

    You'll need to take out the spaces around the < , inserted due to the forum corrupting posts with these symbols.

    I didnt test it, it may be my fault.

    Replace COLUMN()-20 with 1 and as you copy it along the row increase that number each time till you get 5 for column R

  9. #9
    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
    30,947

    Re: COUNTIF error

    Special-K already replied!!

  10. #10
    Registered User
    Join Date
    01-05-2016
    Location
    D.C.
    MS-Off Ver
    Office 2016
    Posts
    29

    Re: COUNTIF error

    Special K - I've removed the spaces and changed COLUMN 20 to 1 (both replacing only the number and replacing the entire "COLUMN()-20" with 1, as I wasn't sure which you intended. It didn't like either one of the formulas....so I still must be doing something wrong. Thoughts?

    =IFERROR(INDEX($N$2:$R$5,SMALL(IF($O$2:$O$5<TODAY()+10,ROW(INDIRECT("1:"&ROWS($N$2:$N$5)))),ROW(N1)),COLUMN()-1),"")}

    =IFERROR(INDEX($N$2:$R$5,SMALL(IF($O$2:$O$5<TODAY()+10,ROW(INDIRECT("1:"&ROWS($N$2:$N$5)))),ROW(N1)),1,"")}

  11. #11
    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
    30,947

    Re: COUNTIF error

    In U2

    =IFERROR(INDEX($N$2:$R$6,SMALL(IF($O$2:$O$6 < TODAY()+10,ROW(INDIRECT("1:"&ROWS($N$2:$N$6)))),ROW(N1)),COLUMNS($A:A)),"")

    Enter with Ctrl+Shift+Enter

    Copy across

  12. #12
    Registered User
    Join Date
    01-05-2016
    Location
    D.C.
    MS-Off Ver
    Office 2016
    Posts
    29

    Re: COUNTIF error

    This worked brilliantly - thank you!

  13. #13
    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
    30,947

    Re: COUNTIF error

    Thanks are due to Special-K - it's his formula!

+ 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] Countif gives an error
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2016, 04:48 PM
  2. Countif error
    By krishnaa_kumarr88 in forum Excel General
    Replies: 5
    Last Post: 10-30-2014, 11:10 AM
  3. [SOLVED] Countif Error
    By Bobby82 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-18-2012, 07:44 AM
  4. countif error?
    By Blake 7 in forum Excel General
    Replies: 3
    Last Post: 03-29-2011, 02:25 AM
  5. countif error
    By mic_speedy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-02-2010, 05:13 AM
  6. Countif Error
    By lmjones78 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-11-2009, 01:37 PM
  7. CountIf #VALUE! Error
    By JFrizzle in forum Excel General
    Replies: 4
    Last Post: 02-20-2009, 02:28 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