+ Reply to Thread
Results 1 to 16 of 16

need help with COUNTA formula

  1. #1
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    need help with COUNTA formula

    I want to count cells those have text in a specific month (example January),
    I have tried following but it doesn't work, please help.

    =IF(B2(MONTH(1)),CONTA(B3:B11,D3:D11),"")



    Thanks.

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: need help with COUNTA formula

    You might need to attach a sample workbook. You have a syntax error in your formula;
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    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,926

    Re: need help with COUNTA formula

    You have more than a syntax error.
    This part is wrong...
    =IF(B2(MONTH(1)),CONTA(B3:B11,D3:D11),"")
    That should be something like...
    =IF(B2=(MONTH(1)),CONTA(B3:B11,D3:D11),"")
    however, any value in B2 will return 1, and any text in B2 will return error, so that test will always only ever give 1 or error

    Do the cells contain actual text (Jan, Feb etc) or do they contain real dates?
    Can you show some samples of what you have, and what you want?
    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

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: need help with COUNTA formula

    @Ford

    CONTA( ???
    Last edited by sandy666; 02-09-2018 at 12:02 AM.

  5. #5
    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,926

    Re: need help with COUNTA formula

    Quote Originally Posted by sandy666 View Post
    @Ford

    CONTA( ???
    haha good catch Sandy, I was focused on the entire formula and what it was trying to do - did not even notice the typo from the OP - thanks. The whole formula is pretty much errors

    Thanks

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: need help with COUNTA formula

    We need smiles, Ford

  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,926

    Re: need help with COUNTA formula

    YesA we DoA
    lol

  8. #8
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: need help with COUNTA formula

    You are right correct way should be
    =IF(B2=(MONTH(1)),COUNTA(B3:B11,D3:D11),"")

    but it still doesn't count.

    cell B2 is formatted to date, type 1-Jan-2018
    (no text at all).



    Quote Originally Posted by FDibbins View Post
    You have more than a syntax error.
    This part is wrong...
    =IF(B2(MONTH(1)),CONTA(B3:B11,D3:D11),"")
    That should be something like...
    =IF(B2=(MONTH(1)),CONTA(B3:B11,D3:D11),"")
    however, any value in B2 will return 1, and any text in B2 will return error, so that test will always only ever give 1 or error

    Do the cells contain actual text (Jan, Feb etc) or do they contain real dates?
    Can you show some samples of what you have, and what you want?

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

    Re: need help with COUNTA formula

    Have you tried just COUNT?
    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.

  10. #10
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: need help with COUNTA formula

    Yup, just tried. Didn't work



    Quote Originally Posted by AliGW View Post
    Have you tried just COUNT?

  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
    80,460

    Re: need help with COUNTA formula

    Attach the workbook.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  12. #12
    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,926

    Re: need help with COUNTA formula

    Quote Originally Posted by mikehk View Post
    You are right correct way should be
    =IF(B2=(MONTH(1)),COUNTA(B3:B11,D3:D11),"")

    but it still doesn't count.

    cell B2 is formatted to date, type 1-Jan-2018
    (no text at all).
    Yes, I already mentioned that...
    =IF(B2=(MONTH(1)),CONTA(B3:B11,D3:D11),"")
    however, any value in B2 will return 1, and any text in B2 will return error, so that test will always only ever give 1 or error
    So that wont work anyway.

    Also, just because a cell is formatted to a date, still doesnt mean it contains an actual date - it could still just be text looking like a date.
    Do a quick test...=isnumber(B2) if it returns FALSE, you have text

    Lets see a sample workbook, then we can all stop guessing

  13. #13
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: need help with COUNTA formula

    Workbook attached herewith.
    Attached Files Attached Files
    Last edited by AliGW; 02-09-2018 at 05:22 AM.

  14. #14
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: need help with COUNTA formula

    maybe
    =SUM(ISNUMBER($B$2)*(MONTH($B$2)=1)*COUNTA($B$3:$B$7),ISNUMBER($D$2)*(MONTH($D$2)=1)*COUNTA($D$3:$D$7)) with CSE

  15. #15
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: need help with COUNTA formula

    Perfect, this works

    Thanks a lot

    Quote Originally Posted by sandy666 View Post
    maybe
    =SUM(ISNUMBER($B$2)*(MONTH($B$2)=1)*COUNTA($B$3:$B$7),ISNUMBER($D$2)*(MONTH($D$2)=1)*COUNTA($D$3:$D$7)) with CSE
    Last edited by mikehk; 02-11-2018 at 10:58 PM.

  16. #16
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: need help with COUNTA formula

    I'm glad it works for you

    If that takes care of your original question, & to say Thanks, please click on Add Reputtion (bottom left corner of the post of the person(s) who helped you)
    then select Thread Tools from the menu (top right corner of your thread) and mark this thread as SOLVED.
    If you did it already - ignore it.
    Thank you.

+ 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] COUNTA Formula
    By fearonc in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-27-2017, 03:54 PM
  2. COUNTA formula with criteria
    By SueBristow in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-23-2017, 03:09 PM
  3. COUNTA formula
    By plannerg in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-10-2012, 07:06 PM
  4. CountA Formula
    By MrPlastics in forum Excel General
    Replies: 1
    Last Post: 09-20-2007, 10:46 AM
  5. formula Counta
    By tangomj in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-07-2007, 05:45 PM
  6. Counta formula
    By lla in forum Excel General
    Replies: 1
    Last Post: 05-10-2006, 07:30 PM
  7. COUNTA for a cell with a formula
    By Steve Jackson in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-19-2006, 03:15 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