From: SLP on
Hi,

I have a formula to which I need to add 5, 10, 15, and 20 years to cell H5.
Hope someone can help me our as I can't figure it out. Thanks much!

=ROUND(IF(AND(EmployeeData!$H5<G$4,EmployeeData!$H5>=F$4),IF(YEAR(G$4)-YEAR(EmployeeData!$F5)=5,EmployeeData!$O5*EmployeeData!AM5*ProgramOverview!$AR5,IF(YEAR(G$4)-YEAR(EmployeeData!$F5)=10,EmployeeData!$O5*EmployeeData!AM5*ProgramOverview!$AR5,IF(YEAR(G$4)-YEAR(EmployeeData!$F5)=15,EmployeeData!$O5*EmployeeData!AM5*ProgramOverview!$AR5,IF(YEAR(G$4)-YEAR(EmployeeData!$F5)=20,EmployeeData!$O5*EmployeeData!AM5*ProgramOverview!$AR5,0)))),0),2)
From: Rick Rothstein on
I'm confused by the formula you posted. It *looks* like you are returning
the same value, namely this...

EmployeeData!$O5*EmployeeData!AM5*ProgramOverview!$AR5

no matter if the difference in years is 5, 10, 15 or 20. and this returned
value has nothing to do with cell H5. Can you clarify please.

--
Rick (MVP - Excel)


"SLP" <SLP(a)discussions.microsoft.com> wrote in message
news:2397B868-9145-4644-ABE7-4A54E062E5C1(a)microsoft.com...
> Hi,
>
> I have a formula to which I need to add 5, 10, 15, and 20 years to cell
> H5.
> Hope someone can help me our as I can't figure it out. Thanks much!
>
> =ROUND(IF(AND(EmployeeData!$H5<G$4,EmployeeData!$H5>=F$4),IF(YEAR(G$4)-YEAR(EmployeeData!$F5)=5,EmployeeData!$O5*EmployeeData!AM5*ProgramOverview!$AR5,IF(YEAR(G$4)-YEAR(EmployeeData!$F5)=10,EmployeeData!$O5*EmployeeData!AM5*ProgramOverview!$AR5,IF(YEAR(G$4)-YEAR(EmployeeData!$F5)=15,EmployeeData!$O5*EmployeeData!AM5*ProgramOverview!$AR5,IF(YEAR(G$4)-YEAR(EmployeeData!$F5)=20,EmployeeData!$O5*EmployeeData!AM5*ProgramOverview!$AR5,0)))),0),2)