+ Reply to Thread
Results 1 to 4 of 4

countif function or sumif

  1. #1
    Registered User
    Join Date
    07-07-2007
    Posts
    1

    countif function or sumif

    I have number 1 in cell A3.
    In range A6:A5000 I have number 1 many times between empty cells
    How can I have in cell A4 the number of empty cells/rows since the last #1.
    How can I have in cell A5 the average number of times number 1 appeared in the range, and finally,
    Highlight A4 or A6 if the value in A4 is higher than the average (A5).

    This will help a lot. Thanks

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Quote Originally Posted by tipuser
    I have number 1 in cell A3.
    In range A6:A5000 I have number 1 many times between empty cells
    How can I have in cell A4 the number of empty cells/rows since the last #1.
    How can I have in cell A5 the average number of times number 1 appeared in the range, and finally,
    Highlight A4 or A6 if the value in A4 is higher than the average (A5).

    This will help a lot. Thanks
    Try this in A4

    =MAX(IF(ISBLANK(A6:A5000), ROW(A6:A5000),0))-MAX(IF(NOT(ISBLANK(A6:A5000)), ROW(A6:A5000),0)) enter this with Ctrl+Shift+Enter

    Then in A5

    =COUNTIF(A6:A5000,1)

    Then set condition formatting on A4

    Cell value > greater than > A5 then pick the format you require
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    06-15-2007
    Posts
    6

    Red face Thanks oldchippy

    But it didn't work.
    I wanted a4 to count the number of empty cells?rows since the last time the number 1 appeared in the range A6:A5000. for example:
    If the number 1 appeared in cell A11 A4 should show the number 5.
    Can you help me. Thx.

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    OK, misunderstood your question, try this with the help of another cell, put this in B4

    =ADDRESS(MAX(NOT(ISBLANK(A6:A5000))*ROW(A6:A5000)),1) but enter with Ctrl+Shift+Enter

    then in B3

    =MID(C4,3+1,4)-6 this will give you the next blank cell after the last number 1

    or you could try this for the row number of the next empty cell

    =MID(C4,3+1,4)+1

+ 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