Hi,
I am using the formula below to calculate number of people in on any given hour
this has been setup to calculate 22 different times and tell me how many people are in on each hour of the day based on the shift they are on.
Is it possible to improve the formula so I can easily add extra times in colums A and B without having to change the formula each time, as i have this formula 182 times on a sheet.
column A and b have start and end times of shift.
columns D thru J have the days and number of people on each shift.
column v is any extra values - manual entry.
Hope this is of use, Rob.![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)
I am using the formula below to calculate number of people in on any given hour
Code:
=SUM((AND($K5>=$A$4,$K5<=$B$4)*E$4),(AND($K5>=$A$3,$K5<=$B$3)*E$3),(AND($K5>=$A$5,$K5<=$B$5)*E$5),(AND($K5>=$A$6,$K5<=$B$6)*E$6),(AND($K5>=$A$7,$K5<=$B$7)*E$7),(AND($K5>=$A$8,$K5<=$B$8)*E$8),(AND($K5>=$A$9,$K5<=$B$9)*E$9),(AND($K5>=$A$10,$K5<=$B$10)*E$10),(AND($K5>=$A$11,$K5<=$B$11)*E$11),(AND($K5>=$A$12,$K5<=$B$12)*E$12),(AND($K5>=$A$13,$K5<=$B$13)*E$13),(AND($K5>=$A$14,$K5<=$B$14)*E$14),(AND($K5>=$A$15,$K5<=$B$15)*E$15),(AND($K5>=$A$16,$K5<=$B$16)*E$16),(AND($K5>=$A$17,$K5<=$B$17)*E$17),(AND($K5>=$A$18,$K5<=$B$18)*E$18),(AND($K5>=$A$19,$K5<=$B$19)*E$19),(AND($K5>=$A$20,$K5<=$B$20)*E$20),(AND($K5>=$A$21,$K5<=$B$21)*E$21),(AND($K5>=$A$22,$K5<=$B$22)*E$22),(AND($K5>=$A$23,$K5<=$B$23)*E$23),(AND($K5>=$A$24,$K5<=$B$24)*E$24))+V5
this has been setup to calculate 22 different times and tell me how many people are in on each hour of the day based on the shift they are on.
Is it possible to improve the formula so I can easily add extra times in colums A and B without having to change the formula each time, as i have this formula 182 times on a sheet.
column A and b have start and end times of shift.
columns D thru J have the days and number of people on each shift.
column v is any extra values - manual entry.
Hope this is of use, Rob.
![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)