View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default Creating a commission function

Hi. Would this work for you instead:

Function Commission(n)
Commission = WorksheetFunction.Min(0.15 * n, 750 + 0.1 * n, 2000 + 0.05 *
n, 4000 + 0.01 * n)
End Function

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


wrote in message
ups.com...
Yes, I'm trying to do this in VBA with nested if statements and naming
it as a function so I can use it on a sheet to calculate the
commissions.

I'm not sure how a table would work with this and with only 4 layers it
should be easy with if statements.