+ Reply to Thread
Results 1 to 4 of 4

counting whole and decimal numbers separately

Hybrid View

  1. #1
    Registered User
    Join Date
    04-06-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    15

    counting whole and decimal numbers separately

    I want to have formulas that separately counts whole numbers (1,2,3........) and numbers with decimal points (1.1, 1.2, 1.1.1, 1.1.2.........).

    Example:
    1
    1.1
    1.1.1
    2
    2.1
    2.1.1

    I tried the COUNT formula but counted not only the whole #s 1&2 but also includes 1.1 & 2.1.
    I tried the COUNTA formula but counted all numbers (whole and with the decimal points)
    I need a formula that counts only the whole number and a separate formula that counts the numbers with decimal points.

    Help.

  2. #2
    Forum Contributor
    Join Date
    01-24-2011
    Location
    Sheppey
    MS-Off Ver
    Excel 2010
    Posts
    239

    Re: counting whole and decimal numbers separately

    I can do this by using 2 extra columns to seperate the numbers before summing up.
    Use " =IF(B5=INT(B5),B5,0) " where B5 is where your first number is then copy down. This seperates the whole numbers
    Then use " =IF(B5<>INT(B5),B5,0) " for the decimals.

  3. #3
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: counting whole and decimal numbers separately

    Assuming your data starts in A1, you could do this instead:

    =SUMPRODUCT(((A1:A6)/ROUND(A1:A6,0)=1)*1)

    This counts the number of whole numbers. And then you can do this for decimal numbers:

    =COUNT(A1:A6)-SUMPRODUCT(((A1:A6)/ROUND(A1:A6,0)=1)*1)
    Sincerely
    S?ren Larsen

    "Give a man a fish, and you'll feed him for a day. Give a man a fishing rod, and he'll steal your yacht!"

  4. #4
    Registered User
    Join Date
    04-06-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: counting whole and decimal numbers separately

    Thank you, Larsen. That did it!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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