View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sandy Mann Sandy Mann is offline
external usenet poster
 
Posts: 2,345
Default HOW DO I SET UP AN IF STATEMENT THAT WILL UPDATE MONTHLY

Please don't post in all upper case letters, it makes you post harder to
read and is considered shouting in the Newsgroups.

I would put the month numbers of the the last month and the month before
that in two cells, say E2 & F2:

Last Month in E2:
=MONTH(TODAY()-DAY(TODAY()))

Month before that in F2:
=IF(E2-1=0,12,E2-1)

With the dates in Column G and the amounts in Column H, to calculate the the
difference between Last Month and the month before that use:

=SUMPRODUCT((MONTH(G1:G730)<"")*(MONTH(G1:G730)=E 2)*(H1:H730)-(MONTH(G1:G730)<"")*(MONTH(G1:G730)=F2)*(H1:H730) )

You say you know how to do the IF() statement so I am sure that you can
incorporate it into your IF() statement as you require.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"DEVONA" wrote in message
...
I AM WORKING ON A SPREADSHEET TO TRACK MONTHLY SALES. I WANT TO DO AN IF
STATEMENT THAT WILL TELL ME IF SALES ARE UP OR DOWN COMAPAIRING THE LAST
MONTH TO THE PRIOR MONTH. I KNOW HOW TO DO THE IF STATEMENT. BUT WHAT I
DONT
KNOW HOW TO DO IS SET IT UP TO UPDATE EACH TIME A NEW MONTH ENDS.

FOR EXAMPLE I WANT TO COMPARE SALES FOR DEC WITH NOV WERE THEY UP OR DOWN.
NOW WHEN JANUARY ENDS I WANT TO COMPARE JANUARY WITH DECEMBER. I WOULD
LIKE
THE IF STATEMENT TO UPDATE TO TAKE THE NEW INFORMATION AND COMPARE IT WITH
THE PREVIOUS MONTH WITH OUT HAVING TO GO IN AND ADJUST THE IF STATEMENT
EACH
TIME. CAN THIS BE DONE AND IF SO HOW? I AM USING EXCEL 2003 AT THIS POINT
AND
TIME.