Clif McIrvin
New Member
- Joined
- Dec 22, 2023
- Messages
- 11
- Office Version
- 365
- 2016
- Platform
- Windows
First, I apologize if this has already been addressed. I was unsuccessful at trying to find anything similar.
I have a working formula to average the bottom three values in a filtered list.
My VBA routine which builds the spreadsheet from scratch (reading data from individual files) fails in this loop:
Where ix is the current column number, and AllHistoryFormulas() is an array of formula text.
The code fails when it reaches this formula with:
Error Number 1004
Application-defined or object-defined error
When I attempt to enter this formula in the R1C1 formula bar I get "You've entered too few arguments for this function" with the cursor at the end of the LAMBDA function:
Here's my working formula as shown in the R1C1 formula bar:
And, the same formula in the A1 formula bar:
Clear as mud?
What am I doing wrong?
I'm using .FormulaR1C1 because the formula text does not change with the cell address.
I have a working formula to average the bottom three values in a filtered list.
My VBA routine which builds the spreadsheet from scratch (reading data from individual files) fails in this loop:
VBA Code:
For ix = colAvg To LastDefinedCol
dest.Cells(NextRow, ix).FormulaR1C1 = AllHistoryFormulas(ix)
Next ix
The code fails when it reaches this formula with:
Error Number 1004
Application-defined or object-defined error
When I attempt to enter this formula in the R1C1 formula bar I get "You've entered too few arguments for this function" with the cursor at the end of the LAMBDA function:
Here's my working formula as shown in the R1C1 formula bar:
Excel Formula:
=AVERAGE(TAKE(FILTER(R16C[-4]:RC[-4],MAP(R16C[-4]:RC[-4],LAMBDA(r,--(SUBTOTAL(103,r)=1)))=1),-3))
And, the same formula in the A1 formula bar:
Excel Formula:
=AVERAGE(TAKE(FILTER(R$16:R19,MAP(R$16:R19,LAMBDA(r,--(SUBTOTAL(103,r)=1)))=1),-3))
Clear as mud?
What am I doing wrong?
I'm using .FormulaR1C1 because the formula text does not change with the cell address.