Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry if this is long; I am only just learning function creation....
Public Function ATLN(ATLN_BASE, ATLN_SUM, MONTH_N) Dim lngGrowthTier1 As Long Dim lngGrowthTier2 As Long Dim lngGrowthTier3 As Long mlngMonthlyAccrual = 0 mlngMonthlyAccrual2 = 0 mlngMonthlyAccrual3 = 0 lngGrowthTier1 = 207995 lngGrowthTier2 = 407995 lngGrowthTier3 = 507995 msngGrowth1 = 0.03 msngGrowth2 = 0.04 msngGrowth3 = 0.05 If (ATLN_SUM / MONTH_N) * 12 ATLN_BASE And (ATLN_SUM / MONTH_N) * 12 < 407996 Then mlngMonthlyAccrual = (((ATLN_SUM / MONTH_N) * 12) - lngGrowthTier1) * msngGrowth1 End If If (ATLN_SUM / MONTH_N) * 12 ATLN_BASE And (ATLN_SUM / MONTH_N) * 12 = 407996 And (ATLN_SUM / MONTH_N) * 12 < 507996 Then mlngMonthlyAccrual2 = (((ATLN_SUM / MONTH_N) * 12) - lngGrowthTier2) * msngGrowth2 End If If (ATLN_SUM / MONTH_N) * 12 ATLN_BASE And (ATLN_SUM / MONTH_N) * 12 = 507996 Then mlngMonthlyAccrual3 = (((ATLN_SUM / MONTH_N) * 12) - lngGrowthTier3) * msngGrowth3 End If ATLN = mlngMonthlyAccrual + mlngMonthlyAccrual2 + mlngMonthlyAccrual3 End Function "ytayta555" wrote: Post your formula here |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro : combine results of multiple tables in a folder | Excel Discussion (Misc queries) | |||
Combine results of 2 formulas | Excel Worksheet Functions | |||
Custom Pivot table results | Excel Discussion (Misc queries) | |||
Custom Pivot table results | Excel Programming | |||
Custom Autofilter yields no results | Excel Discussion (Misc queries) |