COUNTIFS Multiple Criteria

lpost1214

New Member
Joined
Nov 9, 2016
Messages
6
Hello,

I am trying to write a COUNTIFS formula to include a criteria that will subtract a value in column P from the row below in column I and if the result is less than 0 then it should be counted, but I can't seem to write this correct so that excel will accept this. Any help is appreciated. Thanks!

IF(B4="","",COUNTIFS($B$4:B4,B4,$O$4:O4,"=0",$P3-$I4, "< 0")*(B4=B4))
[TABLE="width: 65"]
<tbody>[TR]
[TD][TABLE="width: 49"]
<colgroup><col width="65" style="width: 49pt; mso-width-source: userset; mso-width-alt: 2377;"> <tbody>[TR]
[TD="class: xl65, width: 65, bgcolor: transparent"][TABLE="width: 65"]
<tbody>[TR]
[TD][/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
That P3toI4 operation you're trying to include is a range of the wrong size. Excel's Help feature for function COUNTIFS declares, "Each additional range must have the same number of rows and columns as the criteria_range1 argument. The ranges do not have to be adjacent to each other."

You probable need an array formula to complete this task. If you provide some sample data together with expected outcome we can conduct experiments.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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