View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Luke M[_4_] Luke M[_4_] is offline
external usenet poster
 
Posts: 457
Default if function (if more that 7 nesting)

Assuming dates are in col A, data in col B:
=SUMPRODUCT(--(TEXT('Sheet2'!A2:A100,"yyyy")=TEXT(TODAY(),"yyyy" )-1),--(TEXT('Sheet2'!A2:A100,"mm")<=TEXT(TODAY(),"mm")))

will sum everything from this month and earlier for the previous year.

--
Best Regards,

Luke M
"keflow" wrote in message
...
End result is to compare prior year numbers to current year to date
sheet 1 has the following columns-- sheet 2 has history-each month totals
for a number of years

COL A Secured Loan Interest
COL B(current month) 39,333.98
COL C(prior month) $36,134.55
COL D(variance MTD) $3,199.43
COL E(current YTD) $113,440.47
COL F(previous YTD) $512,814.15
All of the information on worksheet is filled in with a vlookup formula.
I want COL F to add up the totals from sheet 2 for each month up to the
current month for this year, so that this year and prior year totals are
for
the same timeframe.
I know that you can only nest 7 if statements in a formula, but I need to
do
12 if's to get all the months totaled. Can anyone help with this?