All,
Can someone advise me on this formula:
=IFERROR(AVERAGEIF(AE4:AZ4,1,E4:Z4),"")
How can you embed an ABS function in there? You cannot put it in here abs(E4:Z4) you will get error on the formula.
appreciate any inputs.
All,
Can someone advise me on this formula:
=IFERROR(AVERAGEIF(AE4:AZ4,1,E4:Z4),"")
How can you embed an ABS function in there? You cannot put it in here abs(E4:Z4) you will get error on the formula.
appreciate any inputs.
Can you post your actual formula?
I'm guessing that is an example because you're doing an average of all 1's.
The average of all 1's is just 1, no matter how many there are.
My bad, you're averaging E to Z, but counting 1's in AE to AZ..
So nevermind that..
Hang on, there's a way.
Last edited by Jonmo1; 06-13-2013 at 01:19 PM.
Try an array formula entered with CTRL + SHIFT + ENTER
=IFERROR(AVERAGE(IF(AE4:AZ4=1,ABS(E4:Z4))),"")
AVERAGEIF (like other xxIF functions) requires ranges, not arrays, for both the criteria and the data to be averaged.
=IFERROR(SUMPRODUCT((AE4:AZ4=1)*ABS(E4:Z4)) / COUNTIF(AE4:AZ4, 1), "")
Well, that's better!Originally Posted by Jonmo
Last edited by shg; 06-13-2013 at 01:37 PM.
Entia non sunt multiplicanda sine necessitate
Jonmo,
Completely forgot about that function.
Thanks a mill.
you can do it like this
=SUMPRODUCT(--(AE4:AZ4=1),ABS(E4:Z4))/COUNTIF(AE4:AZ4,1)
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and now happily retired
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
Just realized that. After you posted, and before I looked closely, I went to VBA to see what Intellisense said:
WorksheetFunction.AverageIf(Arg1 as Range, Arg2, [Arg3])
That, combined with the example I (thought I) saw, made me think I was wrong about the arguments. Intellisense shows the same for the other xxIf and xxIFS functions; only the first shows As Range.
I feel ... betrayed.
The post editing has taken its toll, here, Jonmo
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks