If formula

ad335i

New Member
Joined
Jul 8, 2011
Messages
14
Looking to setup an If formula with multiaple variables

selling apples
for the first apple sold the agent will earn $5
for the second apple sold the agent will earn $10
for the 3rd apple sold the agent will earn $15
and any apple above and including the 4th will earn $ 20 each

so if the agent sold 5 apples they will be paid $70
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Number of Apples in Cell A1

=IF(A1=1,5,IF(A1=2,15,IF(A1=3,30,IF(A1>=4,((A1-3)*20+30),0))))
 
Upvote 0
and try this UDF
Code:
Function MultIt(c As Integer) As Integer
Dim arrC(), i As Long
ReDim arrC(1 To c)

For i = LBound(arrC) To UBound(arrC)
    Select Case i
        Case 1
            arrC(i) = 5
        Case 2
            arrC(i) = 10
        Case 3
            arrC(i) = 15
        Case Else
            arrC(i) = 20
    End Select
Next i
    MultIt = Application.WorksheetFunction.Sum(arrC)

End Function
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,248
Members
452,900
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top