+ Reply to Thread
Results 1 to 10 of 10

Count each occurance in range

  1. #1
    Registered User
    Join Date
    09-14-2006
    Posts
    6

    Count each occurance in range

    Hi,

    I have a column with values and empty cells.
    1-6
    2-9
    3-
    4-2
    5-3

    Now I want to count how many rows have a value.
    in this case it would be 4 as row 3 is empty.
    i just cant get the formula right...

    i tried if(countif(b4:b301;isempty(b4:301;1;0)) and variantions but it didnt work...

    anyidea ?

  2. #2
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by godspeed
    Hi,

    I have a column with values and empty cells.
    1-6
    2-9
    3-
    4-2
    5-3

    Now I want to count how many rows have a value.
    in this case it would be 4 as row 3 is empty.
    i just cant get the formula right...

    i tried if(countif(b4:b301;isempty(b4:301;1;0)) and variantions but it didnt work...

    anyidea ?
    simple COUNT function should work for you
    try this
    =COUNT(A1:A5)
    it will return 4 in your case.

    Regards

  3. #3
    Registered User
    Join Date
    09-14-2006
    Posts
    6
    Tried that, it gives me "name?"

    I have formulas in the empty cells, I guess they are not empty then.... but I just the the amount of 6s,7s in that column..

    best regards
    godspeed

  4. #4
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by godspeed
    Tried that, it gives me "name?"

    I have formulas in the empty cells, I guess they are not empty then.... but I just the the amount of 6s,7s in that column..

    best regards
    godspeed
    if you have all numbers as a result of formulas then try following.
    =COUNTIF(A1:A5,"<>0")
    Last edited by starguy; 09-14-2006 at 07:08 AM.

  5. #5
    Registered User
    Join Date
    09-14-2006
    Posts
    6
    no its not working either..

  6. #6
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    can you put a sample workbook for consideration.

  7. #7
    Registered User
    Join Date
    09-14-2006
    Posts
    6
    Hi,
    I have put an example in the test1 and 2 excels.
    if the test1 is open i can extract data from the cells and i get values in test2. if its closed it shows "#value!"...

    how do i get values if the other excels are closed ? I have a lot and i cannot open all every time to aggregate my data...

    the count thingy works now I altered my data...
    i do countif (a2:a300;">0") now, it gives me 33 (the total of cells containing a number) which is correct. if I do countif (a2:a300;"<>0") it gives me 297 which I cannot derive at all as only 117 cells in that column contain a formula.

    where does the 297 come from and shouldnt >0 and <>0 return the same values ?

    thank s alot
    godspeed..
    Attached Files Attached Files
    Last edited by godspeed; 09-15-2006 at 06:58 AM.

  8. #8
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    you can not fetch values from other book when that book is closed.

    >0 means values which are greater than 0. it will count only numbers which are greater than 0 (ignoring text)
    <>0 means that values which are not equal to 0. putting <>0 in countif function will give number of cells which do not contain 0 but anyother value (it might include text)

    this might help you understand (let me know)
    Regards

  9. #9
    Registered User
    Join Date
    09-14-2006
    Posts
    6
    well if I do

    ='C:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\Rar$DI00.969\[Test1.xls]Sheet1'!$A$2

    it gets the avalues if the other book is closed

    if I do
    =countif('C:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\Rar$DI00.969\[Test1.xls]Sheet1'!$A$2;2)

    it doesnt. whats the difference ?

    does <>0 also count the cells that contain formulas but no value ? I only have 117 of those, with only 84 containing a formula but no value.
    this still doesnt add up to 297...

  10. #10
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Excel functions cannot fetch data from other workbooks when other workbooks are closed.

    countif do not include cell where functions return blank cell or 0

+ 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