Aggregate Var.P

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
3,927
Office Version
  1. 365
Platform
  1. Windows
I have been trying to get Var.P to work in an array formula and I haven't been able to figure it out. I tried using Sumproduct and kind of got it to work, but it was incorporating 0s for the non-matches and gave the wrong answer. So, I wanted to use aggregate to ignore errors. This is the formula I came up with.

Code:
=AGGREGATE(11,3,IF($A$2:$A$468=N2,ABS($F$2:$F$468),NA()))

So, the item I am looking up is in N2.
It looks for a match in column A.
If it matches, it gets the absolute value of the number in column F, else it puts #N/A into the array.

When I step through the formula, it looks like it should work, but it returns a #VALUE error.

Any ideas?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try this array formula that needs to be entered with CTRL-SHIFT-ENTER.

=VAR.P(IF($A$2:$A$468=N2,ABS($F$2:$F$468)))
 
Upvote 0
Perfect. Thanks. It's much better than the alternative that I finally got to work...

=VAR.P(ABS(OFFSET(INDIRECT("A" & MATCH(O2,$A$2:$A$468,0)+1 & ":A" &MAX(IF($A$2:$A$468=O2,ROW($A$2:$A$468)-ROW(INDEX($A$2:$A$468,1,1))+2))),0,5)))
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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