+ Reply to Thread
Results 1 to 2 of 2

COUNTIF Strings > whatever

Hybrid View

  1. #1
    Registered User
    Join Date
    08-27-2017
    Location
    Modesto, CA
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    91

    COUNTIF Strings > whatever

    Where can I learn about how COUNTIF treats Strings with comparison operators? In particular, how it compares strings and numeric values?

  2. #2
    Valued Forum Contributor ffffloyd's Avatar
    Join Date
    05-20-2008
    Location
    Perth, WA, Australia
    MS-Off Ver
    Office 365
    Posts
    249

    Re: COUNTIF Strings > whatever

    I always convert a numeric value to a string before comparing, adding a default (or calculated) number of leading zeroes first.

    For example:

     A       Z
    --- ... ---
     42     =IF(ISNUMBER($A1),RIGHT("00000"&$A1,5),$A1)
      3     00003
    XYZ     XYZ
      2     00002
      1     00001
    999     00999
    ABC     ABC
    333     00333
    That way, you are now always comparing strings to strings and the results are more predictable.
    _______________
    Floyd Emerson
    Business Intelligence Consultant
    Perth, Western Australia

+ 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 cell contains => 3 sub-strings compared to index cell
    By rafaelh9 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 07-27-2016, 06:51 PM
  2. Replies: 12
    Last Post: 07-10-2014, 01:36 AM
  3. Replies: 1
    Last Post: 08-13-2013, 08:32 AM
  4. Replies: 18
    Last Post: 11-04-2012, 06:32 PM
  5. Replies: 5
    Last Post: 02-15-2012, 09:57 AM
  6. Vlookup or Countif using text strings
    By jrabrfc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-10-2009, 06:56 AM
  7. Replies: 5
    Last Post: 07-15-2009, 10:59 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