View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default IF statement comparing month and year separately

On Thu, 26 Apr 2007 10:10:05 -0700, spence
wrote:

I have two cells that contain dates, C4 and G1. I need help writing an IF
statement that says

IF the date in G1 is = C4+60 months AND if the month in C4 and G1 are the
same, then multiple by 1%. Otherwise do nothing.

If possible I need this in a single IF function because it will be nested in
a larger statement and I’m running into Excel’s limit of seven.

Can anyone help me out with the syntax here?

Thanks in advance.

spence



With the Analysis ToolPak installed:

=Cell_Ref * if(and(g1=edate(c4,60),month(c4)=month(g1)),1%,1)

where Cell_Ref is the value you wish to possibly multiply by 1%.
--ron