+ Reply to Thread
Results 1 to 15 of 15

Fill Color based on multiple conditon

  1. #1
    Registered User
    Join Date
    04-10-2022
    Location
    India
    MS-Off Ver
    2016
    Posts
    7

    Fill Color based on multiple conditon

    Hi Friends, Appreciate your support in advance.

    A sample worksheet is attached, in which if column C&D=0 then column B containing "CHERRY" of the same row must be filled with Green color, and if all columns B containing "CHERRY" are filled with Green color, then column A containing "PAUL" must be filled with Green color.

    VBA or Conditional formatting anyone will do.

    Thanks
    Elvis.
    Attached Files Attached Files
    Last edited by elvisjj; 09-17-2022 at 11:40 AM.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Fill Color based on multiple conditon

    first of all get rid of your merged cells, they can play havoc with the case you are trying to solve.
    click on one of the merged cells and see what cell reference you choose.
    as your illustration has a varying number of rows associated with the merged cell(name) imagine keeping track of this in an application involving hundreds of rows.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    04-10-2022
    Location
    India
    MS-Off Ver
    2016
    Posts
    7

    Re: Fill Color based on multiple conditon

    Thanks Torachan. I am working in Oil & Gas, here in Column A we have System and Column B Sub-system. System have one or more Sub-sytem which have some tasks which are mentioned in column C, D and goes on. If all the tasks for Sub-system gets completed then the System (Merged Cells) which also gets completed. My manager will ask if any Sub-system or System gets completed, at that time I need to check one by one which will be time consuming. So I asked for some help here.
    If merge cells give problems then please guide me with some other methods for the above situtation.

    Thanks,
    Elvis.
    Last edited by elvisjj; 09-17-2022 at 12:44 PM.

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Fill Color based on multiple conditon

    In column 'A' get rid of the merged cells and put the persons name into each cell then the association along the row is complete.
    before proceeding any further why is 'apple' & 'banana' coloured green ??? - does not appear to follow your description.

  5. #5
    Registered User
    Join Date
    04-10-2022
    Location
    India
    MS-Off Ver
    2016
    Posts
    7

    Re: Fill Color based on multiple conditon

    Torachan I have attached the excel sheet with merge cells removed. As for 'apple' and 'banana' are green because that specified rows tasks are completed.
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,416

    Re: Fill Color based on multiple conditon

    Rule for A1:

    =AND($A1<>"",SUMPRODUCT(($A$1:$A$9=$A1)*($C$1:$D$9=1))=0)

    Applies to: =$A$1:$B$9

    Rule for B1:

    =AND($A1<>"",COUNTIF($C1:$D1,1)=0)

    Applies to: =$B$1:$B$9
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    04-10-2022
    Location
    India
    MS-Off Ver
    2016
    Posts
    7

    Re: Fill Color based on multiple conditon

    Thank you AliGW, as my original file have some difference it gives some error so I have attached my original file in which if N6 & H7 = 0 then E6 (Subsystem) must be filled with YELLOW. If the Subsystem from same System all are YELLOW then the respective System which is column 'C' must be filled with GREEN.

    Thanks
    Elvis.
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,416

    Re: Fill Color based on multiple conditon

    To be clear: my CF formulae do NOT give an error. They do exactly what you asked for based on your original sample file.

    My CF formulae just need tweaking to fit the new data layout. You have made NO ATTEMPT to tweak them. Please do so now and attach the file if you cannot make it work.

  9. #9
    Registered User
    Join Date
    04-10-2022
    Location
    India
    MS-Off Ver
    2016
    Posts
    7

    Re: Fill Color based on multiple conditon

    Sorry AliGW, I did not mean your formala gives error. It's my mistake to attach a sample workbook so I thought I can tweak it but I cannot get the formula right. I have attached the file in my previous post once again attaching here also.

    Thanks,
    Elvis.
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,416

    Re: Fill Color based on multiple conditon

    So you aren't even going to show me WHAT you tried? I'd like to see a bit more effort from you, otherwise you won't learn anything from this.

    Have a look at the attached.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    04-10-2022
    Location
    India
    MS-Off Ver
    2016
    Posts
    7

    Re: Fill Color based on multiple conditon

    Honestly saying I am just learning excel and I know only single condition formula as of now but will try to learn for sure. I have attached the file which needs little modification.

    Thanks,
    Elvis.
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,416

    Re: Fill Color based on multiple conditon

    Is this what you want?

    =AND($C6<>"",SUMPRODUCT(($C$6:$C$108=$C6)*($H$6:$H$108=0)*($N$6:$N$108=0))=COUNTIF($C$6:$C$108,$C6))
    Attached Files Attached Files

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,416

    Re: Fill Color based on multiple conditon

    No reply ...

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

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  14. #14
    Registered User
    Join Date
    04-10-2022
    Location
    India
    MS-Off Ver
    2016
    Posts
    7

    Re: Fill Color based on multiple conditon

    Great and Thank You very much AliGW.

    Elvis.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,416

    Re: Fill Color based on multiple conditon

    No worries. Please mark as solved.

+ 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. Changing FONT and Fill color based on Multiple Criteria
    By thebeastslayer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2020, 01:51 AM
  2. How to automatically sum based upon interior fill color when the fill color changes
    By Murman01 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-10-2017, 10:41 AM
  3. [SOLVED] How to fill color cells based on another cell's fill color?
    By putritersenyum in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-22-2016, 08:58 AM
  4. Cell Fill Color based on multiple criteria
    By Mr Teafortwo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2014, 02:00 PM
  5. [SOLVED] change fill color of a range of cells based on color of a cell?
    By DarMelNel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2014, 04:48 PM
  6. set cell fill color based on multiple conditions
    By StartingOut in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2011, 12:24 AM
  7. VBA-Fill color based on multiple criteria
    By kimmie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2011, 05:46 PM

Tags for this Thread

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