Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Combine Custom Function Results

I have written a function with 3 IF statements for a tiered commission
calculation; is there any way to have the function result include all 3 IF
statement results as a sum?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Combine Custom Function Results

(while I'm waiting for my answer, thought I would respond to yours)

I would use 4 seperate cells, one for each portion, and then a cell that
totals them.

You can always hide the 3 cells you dont want, or put them on another tab.

Otherwise you would need to use a function or subroutine / macro code to do
that.

-phil

"Dale" wrote:

I have written a function with 3 IF statements for a tiered commission
calculation; is there any way to have the function result include all 3 IF
statement results as a sum?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Combine Custom Function Results

That's what I have, a function Macro...and I'm not quite sure how to get it
to sum the three tiers within the function

"Phil" wrote:

(while I'm waiting for my answer, thought I would respond to yours)

I would use 4 seperate cells, one for each portion, and then a cell that
totals them.

You can always hide the 3 cells you dont want, or put them on another tab.

Otherwise you would need to use a function or subroutine / macro code to do
that.

-phil

"Dale" wrote:

I have written a function with 3 IF statements for a tiered commission
calculation; is there any way to have the function result include all 3 IF
statement results as a sum?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Combine Custom Function Results

Post your formula here
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Combine Custom Function Results

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro : combine results of multiple tables in a folder Kevin Excel Discussion (Misc queries) 0 May 22nd 09 05:32 PM
Combine results of 2 formulas ordnance1 Excel Worksheet Functions 2 December 31st 08 05:34 AM
Custom Pivot table results Dev Excel Discussion (Misc queries) 1 October 29th 07 02:08 PM
Custom Pivot table results Dev Excel Programming 1 October 29th 07 02:08 PM
Custom Autofilter yields no results rjejyork Excel Discussion (Misc queries) 4 July 20th 06 09:10 PM


All times are GMT +1. The time now is 01:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"