Populate cells dynamically in a weekly schedule in excel
In this post we are going add one more function to a weekly schedule. We are going to create an array formula to populate cells with information from a schedule sheet.
Here is a picture of the schedule sheet:
From the above picture we understand:
On the 1 of August from 8:00 AM to 10:00 AM the word "Meeting" will populate two cells on weekly schedule.
On the 1 of August from 1:00 PM to 3:00 PM the word "Design" will populate two cells on weekly schedule.
On the 3 of August from 12:00 PM to 4:00 PM the word "Strategies" will populate four cells on weekly schedule.
Here is a picture of the weekly schedule and the populated cells:
Now let us see what happens if we change the date in cell F2 to 9-Aug-2010.
Cell range C4:I4 have new dates. They are dynamic and change depending on the value in cell F2.
The cells in C6:I29 are all empty now. They are also dynamic and change depending on the dates on cell range C4:I4. The cells are empty because nothing is scheduled on these dates. See picure of schedule sheet at the top.
Array formula in C4:
Formula in D4:
Copy cell C5 and paste it into cells E4:I4
Array formula in C6:
Copy cell C6 and paste it into cell range C6:I29.
Conditional formatting
I filled populated cells using conditional formatting.
Named ranges
Start (E2:E5)
End (F2:F5)
Title (B3:B5)
Download excel template
Populate-time-ranges-in-a-weekly-schedule.xlsx
(Excel 2007 Workbook *.xlsx)
Functions in this article:
IF(logical_test;[value_if:true];[value_if_false])
Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE
SMALL(array,k) returns the k-th smallest row number in this data set.
ROW(reference) returns the rownumber of a reference
INDEX(array,row_num,[column_num])
Returns a value or reference of the cell at the intersection of a particular row and column, in a given range
MATCH(lookup_value;lookup_array; [match_type]
Returns the relative position of an item in an array that matches a specified value
IFERROR(value;value_if_error) Returns value_if_error if expression is an error and the value of the expression itself otherwise
WEEKDAY(serialnumber;[return_type])
Returns a number from 1 to 7 identifing the day of the week of a date
MIN(number1,[number2])
Returns the smallest number in a set of values. Ignores logical values and text









January 31st, 2012 at 5:19 pm
Hello Oscar,
I think this is a great schedule template! Thank you! I have been playing around with it and here is my question. On the schedule sheet I want to be able to continue adding different titles and times i.e. continuing the list. How can I do that (bit of an excel novice here) so that it continues to populate as the first three lines do?
Best,
John
February 1st, 2012 at 7:20 am
John,
Let's say you wish to add 3 more titles, so your range becomes from row3 to row8:
COMPLICATED WAY:
Replace formula as follows:
=IFERROR(INDEX(Schedule!$B$3:$B$8,SMALL(IF(((C$4+$B6)>=Schedule!$C$3:$C$8)*((C$4+$B6)=Start)*((C$4+$B6)<End), ROW(Start)-MIN(ROW(Start))+1, ""), 1)), "") + CTRL + SHIFT + ENTER. or COMMAND + RETURN on a mac.
and just modify the named ranges (INSERT/NAME/DEFINE) then change the ranges from row 5 to row 8 for each of the names (End, Start and Title).
Cheers.
Cyril.
February 1st, 2012 at 7:28 am
weird my reply got mixed up:
=IFERROR(INDEX(Schedule!B3:B8,SMALL(IF(((C$4+$B6)>=Schedule!C3:C8)*((C$4+$B6)<Schedule!D3:D8),ROW(Schedule!C3:C8)-MIN(ROW(Schedule!C3:C8))+1,""),1)),"") should be the complicated formula changes
the easiest is just to change the ranged names and modifying the range for each category from 5 to 8 assuming you wish to add 3 more titles (from row 3 to 8 therefore)
Still wondering why my reply got truncated and mixed up...
Cyril
February 1st, 2012 at 4:30 pm
Cheers Cyril!! I took the easy route and modified the ranges!
Best,
John
February 2nd, 2012 at 10:28 pm
Cyril,
Thanks for commenting! WordPress removes html characters http://codex.wordpress.org/Writing_Code_in_Your_Posts
John,
You could create dynamic named ranges:
http://www.get-digital-help.com/2011/04/28/create-a-dynamic-named-range-in-excel/