+ Reply to Thread
Results 1 to 9 of 9

Excel - change cell value on sheet1 based on multiple cell criteria in sheet2 column range

  1. #1
    Registered User
    Join Date
    07-14-2017
    Location
    Calgary, Canada
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Excel - change cell value on sheet1 based on multiple cell criteria in sheet2 column range

    I have 2 worksheets. In the first worksheet (sheet1) I have a cell that can have 3 possible text values of "Not Started", "In Progress", "Completed".

    In the second worksheet(sheet2). I have a column range of cells that can have one of the following status set "Not Started", "In Progress", "N/A", "Completed".

    Sheet1 Column A Cell A1 values (from a list) = "Not Started","In Progress","Completed"

    Sheet 2 Column A Cell A1 values (from a list) = "Not Started","In Progress", "N/A", "Completed"

    I need a formula that will automatically change Sheet1, Cell A1 text to "Not Started" if all of the cells in sheet2 Column A (range) are all set to "Not Started".

    If one of those cells in sheet2 (Column A cell range) has a value of "In Progress", Sheet1 Cell A1 should change to "In Progress".

    If all the Sheet2 (Column A cell range) match "Completed" or "N/A", the Sheet1 Cell A1 should say "Completed".

    I think I need to combine a IF statements with CountIF statements, but not sure how to write this?

    Thank you in advance! Tristan

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: Excel - change cell value on sheet1 based on multiple cell criteria in sheet2 column r

    Try

    =IF(COUNTIF(Sheet2!A:A,"Not started")=COUNTA(Sheet2!A:A),"Not Started",IF(COUNTIF(Sheet2!A:A,"In Progress"),"In Progress",IF(SUM(COUNTIF(Sheet2!A:A,{"N/A","Completed"}))=COUNTA(Sheet2!A:A),"Completed","")))

    Assumes data in Sheet2 starts in A1

    Returns blank if none of the above are met.

  3. #3
    Registered User
    Join Date
    07-14-2017
    Location
    Calgary, Canada
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Re: Excel - change cell value on sheet1 based on multiple cell criteria in sheet2 column r

    That's perfect, except I need one more condition added.

    If Sheet 2 has the following cell values, it shows blank on Sheet1
    A1=Not Started
    A2=Completed
    A3=Not Started.

    Under this scenario, It should change Sheet1 value to "In Progress".

  4. #4
    Registered User
    Join Date
    07-14-2017
    Location
    Calgary, Canada
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Re: Excel - change cell value on sheet1 based on multiple cell criteria in sheet2 column r

    And if I wanted to start it instead of A1 in Sheet2, do I simply modify Sheet2!A:A to be something like Sheet2!A3:A (for cell 3?)

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: Excel - change cell value on sheet1 based on multiple cell criteria in sheet2 column r

    Try this ..

    =IF(COUNTIF(Sheet2!A:A,"Not started")=COUNTA(Sheet2!A:A),"Not Started",IF(COUNTIF(Sheet2!A:A,"In Progress"),"In Progress",IF(SUM(COUNTIF(Sheet2!A:A,{"N/A","Completed"}))=COUNTA(Sheet2!A:A),"Completed","In Progress")))

    Default is "In Progress" rather than blank.

    Change range to A3:A10000 or whatever you think your maximum row will be.

  6. #6
    Registered User
    Join Date
    07-14-2017
    Location
    Calgary, Canada
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Re: Excel - change cell value on sheet1 based on multiple cell criteria in sheet2 column r

    Thank you John so much. Works great!

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: Excel - change cell value on sheet1 based on multiple cell criteria in sheet2 column r

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  8. #8
    Registered User
    Join Date
    07-14-2017
    Location
    Calgary, Canada
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Re: Excel - change cell value on sheet1 based on multiple cell criteria in sheet2 column r

    Hi John,

    Sorry just been testing this some more and it is still not quite working for all the conditions.

    If sheet 2 has a row with "Not Started" and another row with "N/A", it current shows "In Progress". It should remain as "Not Started"

    =IF(COUNTIF(Infrastructure!C3:C1000,"Not started")=COUNTA(Infrastructure!C3:C1000),"Not Started",IF(COUNTIF(Infrastructure!C3:C1000,"In Progress"),"In Progress",IF(SUM(COUNTIF(Infrastructure!C3:C1000,{"N/A","Completed"}))=COUNTA(Infrastructure!C3:C1000),"Completed","In Progress")))

    I tried to modify the formula to change the first 2 conditions to also use the Sum(CountIF) formula but I get a #value error.


    The conditions I think I need to add are:
    If N/A or Not Started = Display Not Started
    If N/A or Not Started or In Progress - Display In Progress (is there a way to evaluate 3 conditions?

  9. #9
    Registered User
    Join Date
    07-14-2017
    Location
    Calgary, Canada
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Re: Excel - change cell value on sheet1 based on multiple cell criteria in sheet2 column r

    I figured it out, the solution was:

    =IF(COUNTIF('Infrastructure'!C3:C1000,"Not started")=COUNTA('Infrastructure'!C3:C1000),"Not Started",IF(COUNTIF('Infrastructure'!C3:C1000,"In Progress"),"In Progress",IF(SUM(COUNTIF('Infrastructure'!C3:C1000,{"N/A","Completed"}))=COUNTA('Infrastructure'!C3:C1000),"Completed",IF(SUM(COUNTIF('Infrastructure'!C3:C1000,{"N/A","Not Started"}))=COUNTA('Infrastructure'!C3:C1000),"Not Started","In Progress"))))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Delete rows based on matching dates in Sheet1 Column A with date in Sheet2 Cell K1
    By robertaw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2015, 02:30 PM
  2. Replies: 3
    Last Post: 09-24-2015, 08:20 AM
  3. [SOLVED] copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2
    By AWITCHER in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-13-2014, 03:20 PM
  4. Replies: 1
    Last Post: 12-30-2012, 07:52 PM
  5. [SOLVED] Need a macro to Copy Cell in Sheet1 to the next empty cell in Column A, Sheet2
    By killerthun in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-16-2012, 01:21 PM
  6. Macro to copy range of cell from sheet1 to sheet2 based on a cell value in sheet2
    By drgwhizz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-25-2012, 10:39 AM
  7. Hide columns on sheet2 based on cell on sheet1?
    By proepert in forum Excel General
    Replies: 4
    Last Post: 01-25-2010, 09:00 AM

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