Enterted too many arguement for this function

June 9, 2011 at 21:12:42
Specs: Windows Vista
How can I do if I want to add addtional cell to add?
=SUM(MQ4,MQ8,MQ12,MQ16,MQ20,MQ24,MQ28,MQ32,MQ36,MQ40,MQ44,MQ48,MQ52,MQ56,MQ60,MQ64,MQ68,MQ72,MQ76,MQ80,MQ84,MQ88,MQ92,MQ96,MQ100,MQ104,MQ108,MQ112,MQ116,MQ120,MQ124,MQ128,MQ160,MQ164,MQ168,MQ172,MQ176,MQ132,MQ136,MQ140,MQ144,MQ148,MQ152,MQ156, MQ180,MQ184,MQ196,MQ188,MQ192,MQ200,MQ204,MQ208,MQ212, MQ216,MQ220,MQ224,MQ228,MQ232,MQ236,MQ240,MQ244,MQ248,MQ252,MQ256,MQ260,MQ264,MQ268,MQ272,MQ276,MQ280,MQ284,MQ288,MQ292,MQ296,MQ300,MQ304,MQ308,MQ312,MQ316,MQ320,MQ324,MQ328,MQ332,MQ336,MQ340,MQ344,MQ348,MQ352,MQ356,MQ360,MQ364,MQ368,MQ372,MQ376,MQ380,MQ384,MQ388,MQ392,MQ396,MQ400,MQ404,MQ408,MQ412,MQ416,MQ420,MQ424,MQ428,MQ432,MQ436,MQ440,MQ444,MQ448,MQ452,MQ456,MQ460,MQ464,MQ468,MQ472,MQ476,MQ480,MQ484,MQ488,MQ492,MQ496,MQ500,MQ504,MQ508,MQ512,MQ516,MQ520,MQ524,MQ528,MQ532,MQ536,MQ540,MQ544,MQ548,MQ552,MQ556,MQ560,MQ564,MQ568,MQ572,MQ576,MQ580,MQ584,MQ588,MQ592,MQ596,MQ600,MQ604,MQ608,MQ612,MQ648,MQ616,MQ620,MQ624,MQ628,MQ632,MQ636,MQ640,MQ644,MQ652,MQ656,MQ660,MQ664,MQ668,MQ672,MQ676,MQ680,MQ684,MQ688,MQ692,MQ696,MQ700,MQ704,MQ708,MQ712,MQ716,MQ720,MQ724,MQ736,MQ728,MQ732,MQ752,MQ740,MQ744,MQ748,MQ756,MQ760,MQ764,MQ768,MQ772,MQ776,MQ780,MQ784,MQ788,MQ792,MQ796,MQ800,MQ804,MQ808,MQ812,MQ816,MQ820,MQ824,MQ828,MQ832,MQ840,MQ844,MQ848,MQ836,MQ852,MQ856,MQ860,MQ864,MQ868,MQ872,MQ876,MQ880,MQ884,MQ888,MQ892,MQ896,MQ900,MQ904,MQ908,MQ912,MQ916,MQ920,MQ924,MQ928,MQ932,MQ936,MQ940,MQ944,MQ948,MQ952,MQ956,MQ960,MQ964,MQ968,MQ972,MQ976,MQ980,MQ984,MQ988,MQ992,MQ996,MQ1000,MQ1004,MQ1008,MQ1012,MQ1020,MQ1016,MQ1060)

See More: Enterted too many arguement for this function

Report •

June 10, 2011 at 06:52:12
One method is to create a Named Range and then sum the Named Range.

Typically I would suggest this:

Create a Named range as follows:

Select the cells you want to work with.

With the cells selected, click in the white box just above Column A.

Enter a Name, such as MySumCells, and press Enter. Do not just click out
of the box because the name will not be saved. You must press enter.

Then use =SUM(MySumCells)

However, with as many noncontiguous cells as you are trying to SUM, I believe you will run into a limit on how many cells you can use in a Named Range. (I believe it's actually a limit on the number of characters in a Named Range vs. the number of cells.)

You may need to create numerous Named Ranges (MySumCells1, MySumCells2, etc) and then sum them:

=SUM(MySumCells1, MySumCells2, MySumCells3, MySumCells4)

Tell me: Is it true that you are summing every fourth cell in column MQ? If so, a User Defined Function written in VBA might be a better solution.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

June 10, 2011 at 09:06:27
That's correct, every new client I add on I need to add every fouth cell in the column MQ. How would you write up in VBA? Thanks

Report •

June 11, 2011 at 13:16:32
Use Alt F11 to open the VBA editor.

Click Insert...Module

Paste this code into the pane that opens:

Function SumBy4(ByVal arg1, arg2) As Integer
  For myCells = arg1 To arg2 Step 4
   tempSum = tempSum + Range("MQ" & myCells)
 SumBy4 = tempSum
End Function

In any cell in Excel enter:

=SumBy4(arg1, arg2)

Where Arg1 is the first row of your range (e.g. 4) and arg2 is the last cell (e.g. 1060)

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

Related Solutions

Ask Question