+ Reply to Thread
Results 1 to 3 of 3

countif syntax

  1. #1
    Forum Contributor
    Join Date
    09-30-2015
    Location
    LA my baby
    MS-Off Ver
    2013
    Posts
    727

    countif syntax

    Hello. Why does the second formula have to be in quotes?

    Countif(sales, 100)
    Countif(sales, ">=100")

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: countif syntax

    Well, you could also write it like this:

    Countif(sales, ">="&100)

    and the first one could be:

    Countif(sales, "="&100)

    or:

    Countif(sales, "=100")

    COUNTIF (and SUMIF(S) etc.) use the string comparison evaluator, so the second term needs to equate to a string. However, if you are using equals as the comparator, then "=" is optional, as the function is clever enough to deduce what you mean.

    Hope this helps.

    Pete

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

    Re: countif syntax

    the < > and = operators are text, and excel cannot use text in any formula unless you wrap it in "". As Pete said, if you onlu need to use =, then you can actually just leave it out
    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

+ 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] Help with COUNTIF syntax error
    By EngCamel in forum Excel General
    Replies: 5
    Last Post: 07-13-2014, 08:59 AM
  2. Proper syntax to modify a COUNTIF with a SUM?
    By Dwexdwex in forum Excel General
    Replies: 5
    Last Post: 07-28-2013, 02:38 PM
  3. [SOLVED] COUNTIF or COUNTIFS syntax issue
    By K Howe in forum Excel General
    Replies: 4
    Last Post: 03-19-2012, 02:20 PM
  4. CountIf syntax in VBA
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2011, 05:09 AM
  5. Countif vba syntax
    By simon123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2011, 10:45 AM
  6. IF(COUNTIF statement seems to have incorrect syntax
    By dwiseman in forum Excel General
    Replies: 2
    Last Post: 04-27-2010, 10:10 AM
  7. Replies: 1
    Last Post: 05-01-2008, 07:27 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