Calculating the first day of the week
Hello Jimbo,
I think the simplest way to go would be to construct a table. There
are only 7 possible weekday combinations, even if you include Saturday
and Sunday, i.e. MWF,TThSa,WFSu,ThSaM,FSuT,SaMW and SuTTh. Even if
these can be listed in any order there are still only 42 so......
If you list all 42 possibilities in A2:A43 and then in the top row
B1:H1 list the days, Su, M, T, W, Th, F, Sa
Then in the relevant cells put B, M or E, e.g. if A2 is MWF put B in
C2, M in F2 and E in G2, do the same for all rows and leave all the
other cells blank
Now assuming you have a specific schedule in J2, blood collection in
K2, Blood Glucose in L2 then you can use this formula in M2 to get the
recalculated level
=LOOKUP(VLOOKUP(J2,A$2:H$43,MATCH(K2,A$1:H$1,0),0) ,{"B","E","M"},
{-30,10,-5})+L2
Copy the formula down for more data in row 3 onwards
The formula will give #N/A if the schedule shown in J2 is invalid or
if the day shown in K2 isn't in that schedule. You could probably
expand the formula to give some different error messages but you might
like to start with the basic version.
If you want you could have the table on a separate sheet or somewhere
over to the side so that it isn't dispayed, I suggest you start where
I put it and cut and paste the table somewhere else later. References
in the formula will adjust accordingly
Post back if you can't make that work
|