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AL6,
IF(AF6=140,AJ6+AK6+AL6,
IF(AF6=141,AJ6+AK6+AL6+AM6,
IF(AF6=142,AJ6+AK6+AL6+AM6,
IF(AF6=143,AJ6+AK6+AL6+AM6,
IF(AF6=144,AJ6+AK6+AL6,
IF(AF6=145,AJ6+AK6+AL6,
IF(AF6=146,2*AJ6+AK6+2*AL6,
IF(AF6=147,AJ6+AK6+AL6,
IF(AF6=148,AJ6+AK6+AL6+AM6,
IF(AF6=149,AJ6+AK6+AL6+AM6,
IF(AF6=150,AJ6+AK6+AL6+AM6,
IF(AF6=151,AJ6+AK6+AL6+AM6,
IF(AF6=152,2*AJ6+AK6+2*AL6,
IF(AF6=153,AJ6+AK6+AL6+AM6+AN6,
IF(AF6=154,AJ6+AK6+AL6+AM6+AN6,
IF(AF6=155,AJ6+AK6+AL6+AM6+AN6,
IF(AF6=156,AJ6+AK6+AL6+AM6+AN6+AO6,
IF(AF6=157,2*AJ6+2*AK6+AL6,
IF(AF6=158,2*AJ6+2*AK6+AL6,
IF(AF6=159,2*AJ6+2*AK6+AL6,
IF(AF6=160,2*AJ6+2*AK6+AL6,
IF(AF6=161,AJ6+AK6+AL6+AM6,
IF(AF6=162,AJ6+AK6+AL6,
IF(AF6=163,AJ6+AK6+AL6,0))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/1000,0.005)
Errors:
i cant give more than 64 arguments
You have Entered too many arguments to this function

Can i get help with this formula or any alternative way?

Tnx for Looking my Thread
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Is it not possible to use more than 64 arguments?

It's a cell reference that cell value changing by triggering if the value is change this formula result must appear in AF6

I don't think it will work with making table
 
Last edited:
Upvote 0
Is it not possible to use more than 64 arguments?
No, as Excel is telling you.
If you ever hit this limit, it is a good indication that you are going about it the wrong way.

Another option may be to create your own function in VBA (User Defined Function) to do it. If you use CASE statements in VBA, you can lump all the different values of AF6 together that result in the same calculation.
 
Upvote 0
No, as Excel is telling you.
If you ever hit this limit, it is a good indication that you are going about it the wrong way.

Another option may be to create your own function in VBA (User Defined Function) to do it. If you use CASE statements in VBA, you can lump all the different values of AF6 together that result in the same calculation.

Can u help me out with case statementIf I get statement sentence

I will fallow that
 
Upvote 0
Upvote 0
I still think Vlookup is your best option here.... make a sheet with the values in column A and the formula from your if statements in column B
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]100[/TD]
[TD]=2*AJ6+2*AK6+AO6[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]101[/TD]
[TD]=2*AJ6+2*AK6+AL6[/TD]
[/TR]
</tbody>[/TABLE]

etc.
then your formula just becomes
Code:
=VLOOKUP(AF6,Sheet1!$A$1:$B$149,2,0)
modify to fit your data.
 
Last edited:
Upvote 0
And here's another thought.

Your original formula contains 64 IF statements.
But there are only 14 unique TRUE arguments.
For example 22 of the IF statements include an instruction to return the result of
AJ6+AK6+AL6.
For example 10 of the IF statements include an instruction to return the result of
AJ6+AK6+AL6+AM6.

What this suggests to me is that there are other ways which you could possibly greatly simplify your challenge.
 
Upvote 0
Can I get help with UDF

I hope it works fine with state statement

With UDF can I create more than 64 arguments?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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