+ Reply to Thread
Results 1 to 6 of 6

How do I set up the formula so that the A is counted?.-Count If

  1. #1
    Registered User
    Join Date
    08-15-2006
    Posts
    71

    How do I set up the formula so that the A is counted?.-Count If

    Hi,

    I have a small problem, I am using the formual below, the criteria in A3 is A, however the data in column in J will sometimes have date such as A/B. When this happens the A is not counted. How do I set up the formula so that the A is counted.

    =COUNTIF('January Consolidation'!$J$9:$J$459,A3)

    Thanks in advance for any help.

    Calli.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =COUNTIF('January Consolidation'!$J$9:$J$459,"*"&A3&"*")
    or starting with A

    =COUNTIF('January Consolidation'!$J$9:$J$459,"*"&A3)
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    If you use wildcards * then this will give you a count when the contents of A3 appear anywhere within the cells in the range, even amongst other text

    =COUNTIF('January Consolidation'!$J$9:$J$459,"*"&A3&"*")

  4. #4
    Registered User
    Join Date
    08-15-2006
    Posts
    71
    Thanks, it worked.

    Also....

    I have put what you gave me into the following formula, but it doesn't work for me.

    =SUMPRODUCT(('December Consolidation'!$J$9:$J$452="*"&A13&"*")*(ISNUMBER(SEARCH("Incomplete",'December Consolidation'!$C$9:$C$452))))

    Cell A13 will have a value of A and Column J will have data such as A/B

    However, when i remove the wild card syntax it works. How do I make the above formula work?

    Calli.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Unfortunately you can't use wildcards the same way with a comparison operator like =, try using another ISNUMBER/SEARCH like this

    =SUMPRODUCT(ISNUMBER(SEARCH(A13,'December Consolidation'!$J$9:$J$452))*ISNUMBER(SEARCH( "Incomplete",'December Consolidation'!$C$9:$C$452)))

  6. #6
    Registered User
    Join Date
    08-15-2006
    Posts
    71
    Exactly, what is the difference between the two besides the syntax,

    =SUMPRODUCT(ISNUMBER(SEARCH(A13,'December Consolidation'!$J$9:$J$452))*ISNUMBER(SEARCH( "Incomplete",'December Consolidation'!$C$9:$C$452)))

    And....

    =SUMPRODUCT(('December Consolidation'!$J$9:$J$452=A13)*(ISNUMBER(SEARCH("Incomplete",'December Consolidation'!$C$9:$C$452))))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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