+ Reply to Thread
Results 1 to 3 of 3

Fill a range of cells based on certain criteria

  1. #1
    Registered User
    Join Date
    06-13-2012
    Location
    Leicester, England
    MS-Off Ver
    MS Office 365
    Posts
    61

    Fill a range of cells based on certain criteria

    I can never get my head around Conditional formatting when using formulas.

    I have attached a worksheet with an example of what I need. I basically have a calendar which a colleague needs automated so he can see at a glance on his phone when out and about at sites. It's for his bookings and details of the jobs. I have split the calendar into months, then into days, and each day has two sections, one for AM jobs and the other PM jobs.

    Because it's split into 4 rows I can't figure out how to highlight all of the cells within that day based on the cell criteria.

    I've given some colour examples on the attachment too and a detail to the right of the calendar of what I would also like it to do which is person specific too.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Fill a range of cells based on certain criteria

    I did it only for the first rule, but next conditions shall be done the same way.

    so for Ryan conformed I selected all cells with calendar (starting B4 and ending H575), from conditional formatting choosen new rule, and then use formula. and as formula I wrote (not just point and click, because by default it will use absolute addresses and we need relative ones):

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Note that you will need to use comma not selicolon as separator.

    this checks 1 of 4 sets of 2 conditions (as any set of 2 conditions would make the cell green, we combine these sets with OR function):
    - current cell content is Ryan and cell 3 rows below i confirmed. This two conditions has to be fulfilled at the same time, thus we connect them by AND (this is a condition which will "lit" topmost cell in 4-cell range)
    - cell one above is Ryan AND cell two below is confirmned
    - cell two above is Ryan AND cell one below is confirmned
    and for last cell in range cell 3 above ryan AND current cell = confirmed

    Note that it may seem it uses references to header cells - not really, checking "- cell one above is Ryan AND cell two below is confirmned" will obviously fail in B4, but when applied to B5 could be right (if it's not Jan 1st :-))


    I hope that after such description preparing yourself next conditions will be pretty simple.

    You can see this formula when you have active cell B4 and use Conditional formatting, Manage rules, Edit rule
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Fill a range of cells based on certain criteria

    Glad to see it was working, and appreciate comment made in reputation acknowlegdement about "my explanation based approach".

    8-)


    This approach fits my proffesional profile (who knows - knows :-))

+ 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. [SOLVED] Excel VBA to fill cells based on three criteria
    By kallukallu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2022, 06:35 PM
  2. Fill Range of Cell Rows Based on Search Criteria
    By sansai in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-23-2020, 11:12 PM
  3. [SOLVED] Auto fill cells based on criteria
    By RIZVI in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-12-2019, 08:03 AM
  4. Fill cells with horizontal and vertical range criteria??
    By kreesh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-24-2017, 10:03 AM
  5. Fill cell with value, based on criteria of other cells
    By grantsmith in forum Excel General
    Replies: 9
    Last Post: 04-02-2017, 08:27 AM
  6. VBA To Fill In Cells Based On Criteria
    By McNulty in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-06-2009, 06:18 AM
  7. Fill cells with color based on criteria in two cells
    By AA in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2006, 07:35 PM

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