View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default sum last N rows not being a weekend

Hi,

Am Tue, 23 Aug 2016 03:33:37 -0700 (PDT) schrieb :

I have data in two columns: column A having dates and a corresponding amount in column B.

Now in column C, I would like to have a formula which would sum the last 10 rows in column B which do not have a weekend in column A, i.e., sum only numbers in column B which is correspond to a weekday for the last 10 weekdays.


try:
=SUMPRODUCT((WEEKDAY(OFFSET($A$1,MATCH(MAX($A:$A), A1:A1000,0)-1,,-10),2)<6)*(OFFSET($A$1,MATCH(MAX($A:$A),A1:A1000,0 )-1,1,-10)))


Regards
Claus B.
--
Windows10
Office 2016