PDA

View Full Version : having the average of last saturday to wednesday



ffarshadd
06-09-2017, 06:19 AM
i have a column for dates. the other column is for numbers.
i need a vba code to calculate the average of numbers from (last Saturday to last Wednesday) of last week(not current week).
for example if today is Thursday i wanna have the average from (last Saturday to last Wednesday) of last week not this Wednesday.

SamT
06-09-2017, 07:19 AM
What if today is Wednesday or Friday, or any other day?

ffarshadd
06-09-2017, 02:07 PM
What if today is Wednesday or Friday, or any other day?

one week is defined from Saturday to Friday in my country. Thursdays and Fridays are always off. we have some random days off according to the calendar so on these days no data is written
whatever today is, I'll need an average for the whole previous week (from sat to wed). i attached a sample