Using ABS in Countifs

Eyale

New Member
Joined
Jan 23, 2019
Messages
9
Am I able to use the ABS function on this formula somehow?


=SUM(COUNTIFS('Sheet1'!A$2:A$191,{"0*","1*","2*","3*","4*","5*","6*","7*","8*","9*"},'Sheet1'!E$2:E$191,">"&F8))


I tried the following but it is not working:


=SUM(COUNTIFS('Sheet1'!A$2:A$191,{"0*","1*","2*","3*","4*","5*","6*","7*","8*","9*"},ABS('Sheet1'!E$2:E$191),">"&F8))


Is there something I am missing here? Tried all sorts of strategies around it and I am not able to do it. Please help.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I think this will work:

=SUMPRODUCT(--(ISNUMBER(0+LEFT('Sheet1'!A2:A191,1))),--(ABS('Sheet1'!E2:E191)>F8))
 
Last edited:
Upvote 0
Please take a minute to read the forum rules on cross-posting, and follow them in future. Thanks.

You could use:

=SUM(COUNTIFS(Sheet1!A$2:A$191,{"0*","1*","2*","3*","4*","5*","6*","7*","8*","9*"},Sheet1!E$2:E$191,{">";"<-"}&F8))
 
Upvote 0
@stevetheFish thank you but that did not work.
@RoryA that is magic! Thank you very much! If you do not mind, may you please explain this bit so that I am not making wrong assumptions and not missing finer details: {">";"<-"}&F8
 
Upvote 0
You have two arrays in that formula. The first one (the {"0*", "1*" etc}) is a horizontal array due to the commas. The second one is the {">";"<-"}&F8 part which creates a vertical array due to the semicolons which is formed as:
">"&F8
"<-"&F8
so it covers the situations of greater than the value in F8 and less than the negated value of F8, which is the same effect as using the absolute value. By having one vertical array and one horizontal one, you get every combination of the two arrays.
 
Upvote 0
Im surprised that sumproduct doesnt work. I cant think of a scenario where it produces a different result to the countifs unless you dont have numbers in column E.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

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