+ Reply to Thread
Results 1 to 12 of 12

Excel 2007 : IF/AND TRUE/FALSE and two criteria

  1. #1
    Registered User
    Join Date
    08-20-2009
    Location
    dallas, texas
    MS-Off Ver
    Excel 2007
    Posts
    8

    IF/AND TRUE/FALSE and two criteria

    i'm guessing that there are many ways to do this, but i cant figure out even one

    my aim is to highlight the last row on data set 2 because the condition in data set 1 is TRUE - that is: a project that John finished in 2004.

    i cant use conditional formatting because the data sets are in two different workbooks. I've tried using IF and AND but got lost. there are many rows of data in the second data set so i need a forumala that can be entered and copied down. also, i only have a decade range in data set 1 but the actual years are presented in data set 2.

    please help - it seems so simple!

    data set 1
    John 2000s TRUE
    John 1970s FALSE
    Peter 1990s FALSE
    Peter 1980s FALSE

    data set 2
    Name Finished
    John 1-Dec-75
    Peter 1-Jan-73
    Paul 1-Jun-00
    James 1-Dec-70
    Isaac 1-Dec-73
    John 1-Jul-04 TRUE


    thanks to everyone who responds. your solutions to other issues have been an invaluable resource for me. this is actually my first posting for help
    Last edited by myparticulars; 08-20-2009 at 04:23 PM. Reason: updated title

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: many possible formulas

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF/AND TRUE/FALSE and two criteria

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  4. #4
    Registered User
    Join Date
    08-20-2009
    Location
    dallas, texas
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF/AND TRUE/FALSE and two criteria

    here you go!

    all projects completed by john in the 2000s decade are highlighted
    all projects completed by isaac in the 1980s decade are highlighted

    thank you.
    Attached Files Attached Files

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF/AND TRUE/FALSE and two criteria

    Name the Ranges in Data1 sheet A1 to A20, Name, B1:B20, Decade, C1:C20, Condition..

    Then go to Data2 sheet, select range from A2 to B38

    go to Home tab, Conditional Formatting and Select New Rule

    Select Use formula to determine which cell to format...

    enter formula:

    =MATCH($A2&FLOOR(YEAR($B2),10)&"TRUE",Name&LEFT(Decade,4)+0&Condition

    click Format and choose colour pattern
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-20-2009
    Location
    dallas, texas
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF/AND TRUE/FALSE and two criteria

    the spreadsheet you attached doesnt show any highlighted cells for TRUE.

    I deleted the formatting and readded the formula you had (same thing):

    =MATCH($A2&FLOOR(YEAR($B2),10)&"TRUE",Name&LEFT(Decade,4)+0&Condition)

    except now it's highlighting everything except Isaac. and when i reopen the spreadsheet it'll show nothing highlighted. huh?

    the formula was more complicated than i expected, but now i'm even more confused!
    Attached Files Attached Files

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF/AND TRUE/FALSE and two criteria

    Weird, if you reselect the range and go back to CF and click Ok, it is okay again... but if you close and re-open it disappears...

    Well try this one....

    Please Login or Register  to view this content.
    I saved and re-opened and it stuck this time.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-20-2009
    Location
    dallas, texas
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF/AND TRUE/FALSE and two criteria

    you're a genius!!

    i'm so glad i didnt try to figure this one out myself

    it works pefectly, thank you so much!

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF/AND TRUE/FALSE and two criteria

    Great.. glad to here it works for you.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  10. #10
    Registered User
    Join Date
    08-20-2009
    Location
    dallas, texas
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF/AND TRUE/FALSE and two criteria

    can i throw one more complication into the mix?

    i'd like to have the decades cut off at a certain point. so 1970s is the last full decade and anything BEFORE 1970 be encompassed into a "pre-1970s category". So if someone completed a project in 1935, it would automatically be grouped into this pre-1970s category. is this even possible?

    thank you again!

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF/AND TRUE/FALSE and two criteria

    Edit the rule to read:

    Please Login or Register  to view this content.
    Note: I changed ISAAC 1970's to TRUE to test....
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    08-20-2009
    Location
    dallas, texas
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF/AND TRUE/FALSE and two criteria

    yay!! works like a charm.

    i'm so grateful for your help, thank you!

+ 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