+ Reply to Thread
Results 1 to 5 of 5

"If statements"

  1. #1
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56

    "If statements"

    I need help with "if statements". Sheet one will contain the following:

    DATE A B C D E
    2/22/2008 TRUE FALSE FALSE FALSE Ron
    2/23/2008 FALSE TRUE TRUE TRUE Phill
    2/24/2008 FALSE TRUE FALSE FALSE Tracy
    2/25/2008 FALSE FALSE FALSE FALSE Sharon
    2/26/2008 TRUE TRUE FALSE TRUE Bill

    On sheet two I need to list any date that has three or more true statements with the coresponding name.
    EXAMPLE:
    2/23/2008 Phill
    2/26/2008 Bill
    Attached Files Attached Files
    Last edited by VBA Noob; 12-28-2008 at 06:42 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Here's one way using functions.

    1) Sheet1!G2: =COUNTIF(B2:E2,TRUE)
    2) Copy from G2 down to G6
    3) Sheet2!A1: =IF(ROW()>COUNTIF(Sheet1!$G$2:$G$6,">2"),"",INDEX(Sheet1!A:A,SMALL(IF(Sheet1!$G$2:$G$6>2,ROW(Sheet1!$G$2:$G$6),""),ROW())))
    This formula is array entered. Hold down the shift and ctrl keys, then press enter.
    4) Sheet2!B1: =IF(A1<>"",INDEX(Sheet1!F:F,SMALL(IF(Sheet1!$G$2:$G$6>2,ROW(Sheet1!$G$2:$G$6),""),ROW())),"")
    This formula is also array entered.
    5) Copy from A1:B1 down to A6.

    There are other ways of doing this that use code. If you are happy with a macro response, or even a User Defined Function, then post back and I'm sure these could be arranged.

    rylo

  3. #3
    Registered User
    Join Date
    05-24-2008
    Location
    San Mateo, Ca
    Posts
    44
    I have an idea that may be simpler, if also slightly intermediate.

    In sheet 1 cell F2, type =countif(B2:E2,TRUE)
    Drag down to include your range, hide column F.

    In sheet 2, in the first cell you want to display a date, type =if(sheet1!F2=>3,sheet1!A2,"")
    In the next colum over, type =if(sheet1!F2=>3,sheet1!E2,"")

    Drag these cells down to include as much range as you need. Then highlight one column and apply a filter. Keep it filtered for non-blanks.

    Dan

    P.S. Put the filter on its own row, then hide that row. The new entries should just stack up below each other.
    Last edited by earthtodan; 05-26-2008 at 07:10 PM.

  4. #4
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56

    Thanks

    Thanks guys

  5. #5
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56

    Solved

    Thanks
    SOLVED

+ 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