+ Reply to Thread
Results 1 to 8 of 8

Thread: Countif

  1. #1
    Registered User
    Join Date
    12-03-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    27

    Countif

    Hello I have the following forumla:

    Code:
    =IF(ISNA(COUNTIF('SUPP LEG FLAGS'!A:B,E56)),"",COUNTIF('SUPP LEG FLAGS'!A:B,E56))
    However if E56 is blank I want the cell to remain clear.

    How would I instigate this?

    Many Thanks

    Andy
    Last edited by Andy2010; 01-20-2010 at 05:06 AM. Reason: Solved

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,124

    Re: Countif

    Try:

    =IF(E56="","",IF(ISNA(COUNTIF('SUPP LEG FLAGS'!A:B,E56)),"",COUNTIF('SUPP LEG FLAGS'!A:B,E56)))
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Countif

    If as implied you're using XL2007 you might want to use:

    Code:
    =IF(E56="","",IFERROR(COUNTIF('SUPP LEG FLAGS'!A:B,E56),""))
    IFERROR obviously not backwards compatible with earlier versions though... (and we're assuming #N/A! is your only underlying error...)

  4. #4
    Registered User
    Join Date
    12-03-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Countif

    Thats Fantastic guys, both work, Think ill have to use the non IFERROR one as people using 2003 will need it to work...

    Whilst im here....to pick brains another one would be:

    Code:
    =IF(ISNA(COUNTIF('SUPP LEG VALUE'!B:B,B5)),"",COUNTIF('SUPP LEG VALUE'!B:B,B5))
    This code is working however in column G of 'SUPP LEG VALUE'! there is a date.

    I would only like it to display the data if the date is after the 01/02/2009. How would i do this?

    Many Thanks

    Andy

  5. #5
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,124

    Re: Countif

    Try

    =IF(ISNA(COUNTIF('SUPP LEG VALUE'!B:B,">=01/02/2009")),"",COUNTIF('SUPP LEG VALUE'!B:B,">=01/02/2009"))

    That;s for one conditon...


    Sorry... are there now 2 conditions.. one for column B and one for column G?
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  6. #6
    Registered User
    Join Date
    12-03-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Countif

    Quote Originally Posted by NBVC View Post
    Try

    =IF(ISNA(COUNTIF('SUPP LEG VALUE'!B:B,">=01/02/2009")),"",COUNTIF('SUPP LEG VALUE'!B:B,">=01/02/2009"))

    That;s for one conditon...


    Sorry... are there now 2 conditions.. one for column B and one for column G?

    Yes there is 2 conditions unfortunatly. The B5 Value must be present in the SUPP LEG VALUE TABLE, but also in the SUPP LEG VALUE TABLE there is a column "G" which contains the date.

    Hope this makes sense?

    Thanks for your help!

    Andy

  7. #7
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,124

    Re: Countif

    You will need SUMPRODUCT then.. which does not allow full column references in PreXL2007

    Code:
    =IF(ISNA(COUNTIF('SUPP LEG VALUE'!$B$1:$B$100,B5)),"",SUMPRODUCT(--('SUPP LEG VALUE'!$B$1:$B$100=B5),--('SUPP LEG VALUE'!$G$1:$G$100>="01/02/2009"+0)))
    Adjust ranges to suit...

    .. this also assumes you are checking for #N/A error only in column B
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  8. #8
    Registered User
    Join Date
    12-03-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Countif

    Thanks that has now worked Cheers

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0