+ Reply to Thread
Results 1 to 13 of 13

'COUNTIF' Function is not preventing '#N/A'

  1. #1
    Registered User
    Join Date
    06-30-2007
    Posts
    51

    'COUNTIF' Function is not preventing '#N/A'

    I am using the following COUNTIF formula which I am sure is supposed to prevent '#N/A' from appearing (According to http://www.ozgrid.com/Excel/stop-na-vlookup.htm)

    Please Login or Register  to view this content.
    However, #N/A is still appearing in the worksheet when no data has been input.

    As this is something we are going to be presenting to a client, I am keen to ensure it doesn't contain #N/A all over it!

    Thanks in anticipation
    Last edited by VBA Noob; 06-05-2008 at 08:51 AM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Quote Originally Posted by carlosbourn
    I am using the following COUNTIF formula which I am sure is supposed to prevent '#N/A' from appearing (According to http://www.ozgrid.com/Excel/stop-na-vlookup.htm)

    Please Login or Register  to view this content.
    However, #N/A is still appearing in the worksheet when no data has been input.

    As this is something we are going to be presenting to a client, I am keen to ensure it doesn't contain #N/A all over it!

    Thanks in anticipation
    I don't really understand the first part
    B10 seems to be the range you test, is PORT the test criteria?

  3. #3
    Registered User
    Join Date
    06-30-2007
    Posts
    51
    Correct - B10 is the range & PORT is the criteria

    (arthurbr - this is based almost entirely on a forumula you helped me with a month or so ago!)

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Quote Originally Posted by carlosbourn
    Correct - B10 is the range & PORT is the criteria

    (arthurbr - this is based almost entirely on a forumula you helped me with a month or so ago!)


    Thx for reminding me
    But I see thet PORT is also used as 2nd in your MATCH function where it should use an array??

  5. #5
    Registered User
    Join Date
    06-30-2007
    Posts
    51
    Hmm, I see what you mean but the formula seems to work absolutely fine and I think the formula you used in my sample last time was also set up like this - see below:

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Could you post your file?

  7. #7
    Registered User
    Join Date
    06-30-2007
    Posts
    51
    Here you go
    Attached Files Attached Files

  8. #8
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi,

    This in G4 and copied down will do what you want
    Please Login or Register  to view this content.
    BUT

    Why can't you use a much simpler construct like this

    Please Login or Register  to view this content.
    Ed
    _____________________________
    Always learning, but never enough!
    _____________________________

  9. #9
    Registered User
    Join Date
    06-30-2007
    Posts
    51
    EdMac - thanks.

    Tried the 1st formula but unfortuntely does not work in the finished workbook (the workbook provided was only a small sample)

    It leaves the cell blank even when entering data in A, B, & C4. I thought that it would only leave blank if those cells are left blank?!?

    With regards to the 2nd formula this does not work as the rate depends on the date (ETA) as well as the port / location.

    Thanks

  10. #10
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi,

    First formula works for me - Can't see why it should behave as you describe.

    Have you tried using the Formula auditing tools to see where it fails select the cell - Tools > Formula auditing > evaluate

    I think that you could leave one expression out to make it

    Please Login or Register  to view this content.
    You could use lookups to allow for different dates, but Index and match work just as well.

    regards

  11. #11
    Registered User
    Join Date
    06-30-2007
    Posts
    51
    Thanks Ed

    This is what the formula looks like on the 'mothership' version(!):

    Please Login or Register  to view this content.
    I have replaced it with the below:

    Please Login or Register  to view this content.
    The cell is now blank, which is great; exactly what I wanted, however when I insert data into A, B & C10 (in this instance) I get #N/A again!

    I've grown to really hate #N/A now!

  12. #12
    Registered User
    Join Date
    06-30-2007
    Posts
    51
    Actually, scratch that - think its working fine now - forgot to insert one bit of data in.

    Thanks EdMac - ever so greatly appreciated!

  13. #13
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Great!

    Thanks for the feedback - post back if you run into any more problems.

    Regards

+ 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. countif function
    By rubio in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 04-11-2008, 05:08 PM
  2. COUNTIF function using a drop down list source data as the criteria.
    By Stevie-B in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-07-2008, 08:22 AM
  3. Glitche in the Countif Function
    By calli in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 12-07-2007, 05:13 PM
  4. COUNTIF Function using more than one criterion
    By ary in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-19-2007, 05:14 AM
  5. Nesting a countif function
    By kevinr1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-20-2007, 09:57 AM

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