(Using Excel on Windows with a 365 subscription)
I have 4 columns.
Column A is store name (Jim's or Jane's).
Column B lists the date (each date from 1/1/2020 to 12/31/2020 repeated 24 times)
Column C lists the hour (so hours 1-24 for 1/1, hours 1-24 for 1/2, and so on for all dates of the year and for both stores)
Column D lists the price (for each hour of each date for each store).
There is also a list of Holiday dates in cells J2:J7.
I need a way to assign each cell in the range E2:E8785 (each hour of each day for Jim's store) a value of either 'Peak' or 'Non-Peak'.
If the date in column B is one of the dates in J2:J7, then the value in column E should be 'Non-Peak'.
However, if not a holiday, it should return 'Peak' if the respective date in column B is a weekday (Mon-Fri) AND if it falls between hours 8-23 (inclusive).And it should return 'Non-Peak' if the respective date in column B is a weekday (Mon-Fri) AND if it falls between hours 1-7 or hour 24.
It should also return 'Non-Peak' if the date falls on the weekend (Sat & Sun all hours).
I've tried various things, and I'm having trouble because I'm not sure if this problem can be solved with one formula that I can enter into E2 and then drag all the way down, or if I need to change how I'm thinking of the problem and break it down into multiple formulas. I'm really not sure the best way to approach it, so any help is much appreciated.
If you can't tell, I'm pretty much a beginner. Appreciate any help or insight you can provide!
I have 4 columns.
Column A is store name (Jim's or Jane's).
Column B lists the date (each date from 1/1/2020 to 12/31/2020 repeated 24 times)
Column C lists the hour (so hours 1-24 for 1/1, hours 1-24 for 1/2, and so on for all dates of the year and for both stores)
Column D lists the price (for each hour of each date for each store).
There is also a list of Holiday dates in cells J2:J7.
CES Excel Exercise (version 2).xlsb | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | Store | Date | Hour | Price | Peak Label | Holidays | |||
2 | Jim's | 1/1/20 | 1 | 31.6992 | 1/1/2020 | ||||
3 | Jim's | 1/1/20 | 2 | 30.5115 | 5/25/2020 | ||||
4 | Jim's | 1/1/20 | 3 | 37.6342 | 7/4/2020 | ||||
5 | Jim's | 1/1/20 | 4 | 30.2575 | 9/7/2020 | ||||
6 | Jim's | 1/1/20 | 5 | 32.2213 | 11/26/2020 | ||||
7 | Jim's | 1/1/20 | 6 | 30.4321 | 12/25/2020 | ||||
8 | Jim's | 1/1/20 | 7 | 37.4319 | |||||
9 | Jim's | 1/1/20 | 8 | 32.2977 | |||||
10 | Jim's | 1/1/20 | 9 | 32.5305 | |||||
11 | Jim's | 1/1/20 | 10 | 30.3367 | |||||
12 | Jim's | 1/1/20 | 11 | 31.7915 | |||||
13 | Jim's | 1/1/20 | 12 | 37.9923 | |||||
14 | Jim's | 1/1/20 | 13 | 39.8293 | |||||
15 | Jim's | 1/1/20 | 14 | 32.9674 | |||||
16 | Jim's | 1/1/20 | 15 | 36.6194 | |||||
17 | Jim's | 1/1/20 | 16 | 34.9222 | |||||
18 | Jim's | 1/1/20 | 17 | 31.6517 | |||||
19 | Jim's | 1/1/20 | 18 | 34.7415 | |||||
20 | Jim's | 1/1/20 | 19 | 38.1258 | |||||
21 | Jim's | 1/1/20 | 20 | 34.8405 | |||||
22 | Jim's | 1/1/20 | 21 | 39.6615 | |||||
23 | Jim's | 1/1/20 | 22 | 34.9142 | |||||
24 | Jim's | 1/1/20 | 23 | 36.3306 | |||||
25 | Jim's | 1/1/20 | 24 | 31.5972 | |||||
26 | Jim's | 1/2/20 | 1 | 38.4143 | |||||
27 | Jim's | 1/2/20 | 2 | 30.4804 | |||||
28 | Jim's | 1/2/20 | 3 | 36.1181 | |||||
29 | Jim's | 1/2/20 | 4 | 31.3793 | |||||
30 | Jim's | 1/2/20 | 5 | 36.5937 | |||||
31 | Jim's | 1/2/20 | 6 | 32.9125 | |||||
32 | Jim's | 1/2/20 | 7 | 30.1631 | |||||
33 | Jim's | 1/2/20 | 8 | 37.8865 | |||||
34 | Jim's | 1/2/20 | 9 | 38.8188 | |||||
35 | Jim's | 1/2/20 | 10 | 32.686 | |||||
36 | Jim's | 1/2/20 | 11 | 39.44 | |||||
37 | Jim's | 1/2/20 | 12 | 33.2197 | |||||
38 | Jim's | 1/2/20 | 13 | 33.3511 | |||||
39 | Jim's | 1/2/20 | 14 | 37.8378 | |||||
40 | Jim's | 1/2/20 | 15 | 35.1233 | |||||
41 | Jim's | 1/2/20 | 16 | 35.8917 | |||||
42 | Jim's | 1/2/20 | 17 | 39.3743 | |||||
43 | Jim's | 1/2/20 | 18 | 32.2757 | |||||
44 | Jim's | 1/2/20 | 19 | 39.1379 | |||||
45 | Jim's | 1/2/20 | 20 | 37.1487 | |||||
46 | Jim's | 1/2/20 | 21 | 38.0503 | |||||
47 | Jim's | 1/2/20 | 22 | 32.1134 | |||||
48 | Jim's | 1/2/20 | 23 | 35.6078 | |||||
49 | Jim's | 1/2/20 | 24 | 36.6932 | |||||
50 | Jim's | 1/3/20 | 1 | 34.681 | |||||
51 | Jim's | 1/3/20 | 2 | 32.3218 | |||||
52 | Jim's | 1/3/20 | 3 | 38.7249 | |||||
53 | Jim's | 1/3/20 | 4 | 39.5939 | |||||
54 | Jim's | 1/3/20 | 5 | 34.4275 | |||||
55 | Jim's | 1/3/20 | 6 | 30.4154 | |||||
56 | Jim's | 1/3/20 | 7 | 35.6202 | |||||
57 | Jim's | 1/3/20 | 8 | 39.1408 | |||||
58 | Jim's | 1/3/20 | 9 | 37.6058 | |||||
59 | Jim's | 1/3/20 | 10 | 32.5984 | |||||
60 | Jim's | 1/3/20 | 11 | 33.5998 | |||||
61 | Jim's | 1/3/20 | 12 | 34.1623 | |||||
62 | Jim's | 1/3/20 | 13 | 38.5912 | |||||
63 | Jim's | 1/3/20 | 14 | 34.1979 | |||||
64 | Jim's | 1/3/20 | 15 | 33.8471 | |||||
65 | Jim's | 1/3/20 | 16 | 35.6418 | |||||
66 | Jim's | 1/3/20 | 17 | 34.3031 | |||||
67 | Jim's | 1/3/20 | 18 | 30.8876 | |||||
68 | Jim's | 1/3/20 | 19 | 34.3648 | |||||
69 | Jim's | 1/3/20 | 20 | 35.324 | |||||
70 | Jim's | 1/3/20 | 21 | 34.8646 | |||||
71 | Jim's | 1/3/20 | 22 | 31.7107 | |||||
72 | Jim's | 1/3/20 | 23 | 37.5624 | |||||
73 | Jim's | 1/3/20 | 24 | 37.5842 | |||||
74 | Jim's | 1/4/20 | 1 | 33.4997 | |||||
75 | Jim's | 1/4/20 | 2 | 37.4538 | |||||
76 | Jim's | 1/4/20 | 3 | 36.9632 | |||||
77 | Jim's | 1/4/20 | 4 | 36.1518 | |||||
78 | Jim's | 1/4/20 | 5 | 38.0904 | |||||
79 | Jim's | 1/4/20 | 6 | 39.1718 | |||||
80 | Jim's | 1/4/20 | 7 | 35.1454 | |||||
81 | Jim's | 1/4/20 | 8 | 33.5299 | |||||
82 | Jim's | 1/4/20 | 9 | 38.3818 | |||||
83 | Jim's | 1/4/20 | 10 | 39.2794 | |||||
84 | Jim's | 1/4/20 | 11 | 36.0251 | |||||
85 | Jim's | 1/4/20 | 12 | 39.8796 | |||||
86 | Jim's | 1/4/20 | 13 | 32.5936 | |||||
87 | Jim's | 1/4/20 | 14 | 38.1273 | |||||
88 | Jim's | 1/4/20 | 15 | 39.234 | |||||
89 | Jim's | 1/4/20 | 16 | 32.4319 | |||||
90 | Jim's | 1/4/20 | 17 | 31.4229 | |||||
91 | Jim's | 1/4/20 | 18 | 39.2753 | |||||
92 | Jim's | 1/4/20 | 19 | 38.3822 | |||||
93 | Jim's | 1/4/20 | 20 | 34.8064 | |||||
94 | Jim's | 1/4/20 | 21 | 39.001 | |||||
95 | Jim's | 1/4/20 | 22 | 32.3328 | |||||
96 | Jim's | 1/4/20 | 23 | 36.9969 | |||||
97 | Jim's | 1/4/20 | 24 | 38.2818 | |||||
98 | Jim's | 1/5/20 | 1 | 31.8911 | |||||
99 | Jim's | 1/5/20 | 2 | 36.5902 | |||||
100 | Jim's | 1/5/20 | 3 | 39.7965 | |||||
101 | Jim's | 1/5/20 | 4 | 31.9386 | |||||
102 | Jim's | 1/5/20 | 5 | 31.9592 | |||||
103 | Jim's | 1/5/20 | 6 | 38.7669 | |||||
104 | Jim's | 1/5/20 | 7 | 30.7101 | |||||
105 | Jim's | 1/5/20 | 8 | 35.8923 | |||||
106 | Jim's | 1/5/20 | 9 | 37.0705 | |||||
107 | Jim's | 1/5/20 | 10 | 36.4278 | |||||
108 | Jim's | 1/5/20 | 11 | 38.7703 | |||||
109 | Jim's | 1/5/20 | 12 | 33.4863 | |||||
110 | Jim's | 1/5/20 | 13 | 36.9384 | |||||
111 | Jim's | 1/5/20 | 14 | 32.2052 | |||||
112 | Jim's | 1/5/20 | 15 | 37.0194 | |||||
113 | Jim's | 1/5/20 | 16 | 36.0485 | |||||
114 | Jim's | 1/5/20 | 17 | 34.918 | |||||
115 | Jim's | 1/5/20 | 18 | 32.7707 | |||||
116 | Jim's | 1/5/20 | 19 | 30.3686 | |||||
117 | Jim's | 1/5/20 | 20 | 34.288 | |||||
118 | Jim's | 1/5/20 | 21 | 38.0167 | |||||
119 | Jim's | 1/5/20 | 22 | 30.8594 | |||||
120 | Jim's | 1/5/20 | 23 | 31.7353 | |||||
121 | Jim's | 1/5/20 | 24 | 30.1511 | |||||
122 | Jim's | 1/6/20 | 1 | 39.6321 | |||||
123 | Jim's | 1/6/20 | 2 | 36.397 | |||||
124 | Jim's | 1/6/20 | 3 | 33.3301 | |||||
125 | Jim's | 1/6/20 | 4 | 36.3367 | |||||
126 | Jim's | 1/6/20 | 5 | 36.0135 | |||||
127 | Jim's | 1/6/20 | 6 | 34.0024 | |||||
128 | Jim's | 1/6/20 | 7 | 31.0391 | |||||
129 | Jim's | 1/6/20 | 8 | 31.3164 | |||||
130 | Jim's | 1/6/20 | 9 | 38.352 | |||||
131 | Jim's | 1/6/20 | 10 | 39.966 | |||||
132 | Jim's | 1/6/20 | 11 | 33.0835 | |||||
133 | Jim's | 1/6/20 | 12 | 39.6447 | |||||
134 | Jim's | 1/6/20 | 13 | 36.9602 | |||||
135 | Jim's | 1/6/20 | 14 | 36.7394 | |||||
136 | Jim's | 1/6/20 | 15 | 36.8171 | |||||
137 | Jim's | 1/6/20 | 16 | 36.5367 | |||||
138 | Jim's | 1/6/20 | 17 | 34.5397 | |||||
139 | Jim's | 1/6/20 | 18 | 32.9585 | |||||
140 | Jim's | 1/6/20 | 19 | 30.3666 | |||||
141 | Jim's | 1/6/20 | 20 | 35.6199 | |||||
142 | Jim's | 1/6/20 | 21 | 38.6363 | |||||
143 | Jim's | 1/6/20 | 22 | 35.9531 | |||||
144 | Jim's | 1/6/20 | 23 | 37.5356 | |||||
145 | Jim's | 1/6/20 | 24 | 34.6482 | |||||
146 | Jim's | 1/7/20 | 1 | 30.9441 | |||||
147 | Jim's | 1/7/20 | 2 | 36.6012 | |||||
148 | Jim's | 1/7/20 | 3 | 35.1579 | |||||
149 | Jim's | 1/7/20 | 4 | 37.0998 | |||||
150 | Jim's | 1/7/20 | 5 | 39.8102 | |||||
151 | Jim's | 1/7/20 | 6 | 35.4471 | |||||
152 | Jim's | 1/7/20 | 7 | 33.9698 | |||||
153 | Jim's | 1/7/20 | 8 | 37.4246 | |||||
154 | Jim's | 1/7/20 | 9 | 37.0545 | |||||
155 | Jim's | 1/7/20 | 10 | 31.6508 | |||||
156 | Jim's | 1/7/20 | 11 | 31.1299 | |||||
157 | Jim's | 1/7/20 | 12 | 36.3928 | |||||
158 | Jim's | 1/7/20 | 13 | 39.2357 | |||||
159 | Jim's | 1/7/20 | 14 | 37.3216 | |||||
Store |
I need a way to assign each cell in the range E2:E8785 (each hour of each day for Jim's store) a value of either 'Peak' or 'Non-Peak'.
If the date in column B is one of the dates in J2:J7, then the value in column E should be 'Non-Peak'.
However, if not a holiday, it should return 'Peak' if the respective date in column B is a weekday (Mon-Fri) AND if it falls between hours 8-23 (inclusive).And it should return 'Non-Peak' if the respective date in column B is a weekday (Mon-Fri) AND if it falls between hours 1-7 or hour 24.
It should also return 'Non-Peak' if the date falls on the weekend (Sat & Sun all hours).
I've tried various things, and I'm having trouble because I'm not sure if this problem can be solved with one formula that I can enter into E2 and then drag all the way down, or if I need to change how I'm thinking of the problem and break it down into multiple formulas. I'm really not sure the best way to approach it, so any help is much appreciated.
If you can't tell, I'm pretty much a beginner. Appreciate any help or insight you can provide!