+ Reply to Thread
Results 1 to 5 of 5

IF for multiple columns across workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    3

    IF for multiple columns across workbook

    I am creating an engineering project checksheet and need to put a status flag on the front page. The status flag will display either "NG" or "OK" with Conditional Formatting to color code red or green respectively.

    The conditions that need to be met (sorry for my non-Excel formula ... just trying to explain):

    IF (Sheet:'Place Review':Column F="Open" AND Sheet:'Place Review':Column G="N" AND Sheet:'Route Review':Column F="Open" AND Sheet:'ROUTE Review':Column G="N") THEN "NG" ELSE "OK"

    Basically, I want it to search these 4 columns for either an "Open" or "N" and if it exists, set the flag to NG. FWIW, those columns are controlled by a list so the data can only be Open/Closed or Y/N. The number of rows in these columns is open-ended as these 2 sheets are an open issues list that could contain anywhere from zero to ? rows of issues.

    Make sense? If so, PLEASE HELP ME!!!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,433

    Re: IF for multiple columns across workbook

    So, if you had this formula on row 10 of your front page, for example, would the cells that we are checking also be on the same row in those other sheets, or could they be anywhere? If anywhere, then what other item of data is there that we can use to find the corresponding row(s) on the other sheets - some unique ID or project number perhaps?

    Pete

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: IF for multiple columns across workbook

    See attached. I want the formula on M2 of the Summary page and you'll see the other columns I am referring to in the workbook. I am not looking to do this on a cell-to-cell basis, but rather just one status cell if ANY of the cells in those 4 columns contain "Open" or "N".
    Attached Files Attached Files
    Last edited by craigtone; 07-31-2012 at 03:37 PM.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,433

    Re: IF for multiple columns across workbook

    Okay, you could probably do it like this:

    =IF(AND(COUNTIF('Place Review'!F:F,"Open"),COUNTIF('Place Review'!G:G,"N"),COUNTIF('Route Review'!F:F,"Open"),COUNTIF('Route Review'!G:G,"N")),"NG","OK")

    Very similar to how you had written it !!


    Note: COUNTIF returns a number, and so I could have written >0 after each COUNTIF expression, but in this case that is implied as every value not equal to zero would be treated as TRUE.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    07-31-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: IF for multiple columns across workbook

    That worked except I had to change 'AND' to 'OR'!

    Thanks a million!

+ 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