ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   HELP!!!!! (https://www.excelbanter.com/excel-worksheet-functions/17637-re-help.html)

Rowan

HELP!!!!!
 
You have two options. You could try using the OR statement in your existing
formula:

=IF(F7=27000,(19200/$G$4),IF(F7=26500,(F7-100)*($G$4)/($G$4),IF(F7=25000,(F7-200)*($G$4)/($G$4),IF(OR(F6=6500,F6=6000,F6=5500,F6=5000),(241 00)-(P3+P4)/($G$4)*($G$4),IF(F7=17000,(12000/$G$4),(F7-200)*($G$4)/($G$4))))))

Or you could set up a user defined function in a VBA module along the lines
of:

Function MyFunction(testVal1 As Range, testVal2 As Range, _
Const1 As Range, Const2 As Range, const3 As Range)

If testVal1 = 27000 Then
MyFunction = 19200 / Const1

ElseIf testVal1 = 26500 Then
MyFunction = (testVal1 - 100) * (Const1 / Const1)

ElseIf testVal1 = 25000 Then
MyFunction = (testVal1 - 200) * (Const1 / Const1)

ElseIf testVal2 = 6500 Then
MyFunction = 24100 - (Const2 + const3) / Const1 * Const1

ElseIf testVal2 = 6000 Then
MyFunction = 24100 - (Const2 + const3) / Const1 * Const1

ElseIf testVal2 = 5500 Then
MyFunction = 24100 - (Const2 + const3) / Const1 * Const1

ElseIf testVal2 = 5000 Then
MyFunction = 24100 - (Const2 + const3) / Const1 * Const1

ElseIf testVal1 = 17000 Then
MyFunction = 12000 / Const1

Else
MyFunction = (testVal1 - 200) * (Const1 / Const1)
End If

End Function

In your worksheet you could then enter =myfunction(F7,F6,G4,P3,P4) to get
the same result.

Regards
Rowan

"Dougieg" wrote:

Hi there...

Is there any way to make the following formula shorter??? This is
ridiculous, and I need the formula to evaluate such as it does... Sorry for
the crosspost, but I am desperate!!!!


=IF(F7=27000,(19200/$G$4),IF(F7=26500,(F7-100)*($G$4)/($G$4),IF(F7=25000,(F7-200)*($G$4)/($G$4),IF(F6=6500,(24100)-(P3+P4)/($G$4)*($G$4),IF(F6=6000,(24100)-(P3+P4)/($G$4)*($G$4),IF(F6=5500,(24100)-(P3+P4)/($G$4)*($G$4),IF(F6=5000,(24100)-(P3+P4)/($G$4)*($G$4),IF(F7=17000,(12000/$G$4),(F7-200)*($G$4)/($G$4)))))))))


Thank you

Doug





All times are GMT +1. The time now is 03:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com