View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
San[_4_] San[_4_] is offline
external usenet poster
 
Posts: 26
Default Help required on Tabulating monthly expenses for the Current Month,Previous Month and Month previous to that

Hi

I have a data sheet where I record daily expenses date-wise. From that I tabulate the monthly expenses under "Current Month" , Month before current (Month[-1], and the Month previous to that (Month[-2]. For this, I have a column C that gives the Month serial no. as per the corresponding date, From that I calculate as follows

CURRENT MONTH EXPENSES D2= ROUND(SUM(INDEX(Cost!$A$2:$Y$3615,MATCH(MONTH(NOW( )),Cost!$C$2:$C$3615,0),25):Cost!$Y$3615),0))
MONTH[-1] EXPENSES D3= ROUND(SUM(INDEX(Cost!$A$2:$Y$3615,MATCH(MONTH(NOW( ))-1,Cost!$C$2:$C$3615,0),25):Cost!$Y$3615),0)-D2
MONTH[-2] EXPENSES D4=ROUND(SUM(INDEX(Cost!$A$2:$Y$3615,MATCH(MONTH(N OW())-2,Cost!$C$2:$C$3615,0),25):Cost!$Y$3615),0)-D2-D3

This works well till December. But when it comes to January and the Month number becomes 1 again, this formula will not work for calculating previous months' cost.

I would be immensely grateful if I could get an idea on how to trap the previous months' expenses when the current month becomes January

Thanks