+ Reply to Thread
Results 1 to 5 of 5

COUNTIF with Decimal Numbers Acting as Whole Numbers

  1. #1
    Forum Contributor
    Join Date
    04-23-2014
    Location
    United Kingdom
    MS-Off Ver
    Microsoft 365
    Posts
    149

    COUNTIF with Decimal Numbers Acting as Whole Numbers

    I'm trying to construct a COUNTIF formula which counts the number of 3s (rounded) in a given range. The problem is, these numbers are decimal and therefore are not being read. Even when I use the ROUND function I cannot get it to count them.

    This is the formula I'm currently using:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And this is the range of data I am counting.

    3.00000032436
    0.00000032436
    3.00000091496
    3.00000032436
    3.00000038436
    0.00000024269

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,495

    Re: COUNTIF with Decimal Numbers Acting as Whole Numbers

    use a countifs

    COUNTIFS(A1:F1;">=3";A1:F1;"<4")

    or

    COUNTIFS(A1:F1;">=3";A1:F1;"<3.005")

    in what ever precision you want.

  3. #3
    Forum Contributor
    Join Date
    04-23-2014
    Location
    United Kingdom
    MS-Off Ver
    Microsoft 365
    Posts
    149

    Re: COUNTIF with Decimal Numbers Acting as Whole Numbers

    Quote Originally Posted by Roel Jongman View Post
    use a countifs

    COUNTIFS(A1:F1;">=3";A1:F1;"<4")

    or

    COUNTIFS(A1:F1;">=3";A1:F1;"<3.005")

    in what ever precision you want.
    I know I said I was counting 3s, but really I need an adaptable formula that can cater for different numbers as well. I need it to round up or down the numbers in a range to whole numbers. 0.00000000001 would be 0, 3.49999999999 would be 3, 1.83679146257 would be 2 etc.

  4. #4
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,495

    Re: COUNTIF with Decimal Numbers Acting as Whole Numbers

    you do not need to round for that you can just incorporate in formula, normal rounding rules are not difficult to calculate upper and lower limit without rounding formula.

    Lets assume that the value you look for is in cel A3

    then the formula is

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    if in A3 you put wholenumeber 3
    Than any value between 2,5 and 3,499999.... will count for the countif formula above

    You can make it more flexible by have 2 input cells for upper and lower limit. Then you can control exact range of numbers to find

    If you need something different then please upload en excel example file it is then a lot easier to see what you mean and to build working formula.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,976

    Re: COUNTIF with Decimal Numbers Acting as Whole Numbers

    maybe:
    ** CSE formulas
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    * $E$1 --> spec
    myNums --> test numbers
    Ben Van Johnson

+ 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. Replies: 4
    Last Post: 12-17-2015, 12:33 AM
  2. Replies: 3
    Last Post: 08-28-2013, 08:45 AM
  3. Replies: 4
    Last Post: 12-26-2012, 05:37 AM
  4. Replies: 2
    Last Post: 04-21-2010, 04:41 PM
  5. Numbers acting as text
    By wjones in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2009, 03:58 AM
  6. Replies: 4
    Last Post: 08-15-2006, 09:20 PM
  7. [SOLVED] Decimal numbers not recognized as numbers
    By Stein Kristiansen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-13-2005, 06:06 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