Non-Contiguous COUNTIF range

howesmr

New Member
Joined
Aug 10, 2018
Messages
3
Hello All,
I am struggling to find a way to COUNTIF the rows label 'Qty' are less than a value. I have tried naming the range but COUNTIF doesn't seem to work on a named range. Ultimately I would like formulas to for Qty < 30, Qty < 40, etc. I would do the same with time (formatted in m:ss) The whole sheet is quite massive.

The only way I have been successful is to duplicate the qty values in helper cells way off to the right then do a COUNTIF on that range, and again with the Times. But size of the data and the different variables I need to do this it is becoming quite massive with 100,000s extra albeit simple formulas where it could be 10 COUNTIF formulas for each variable.

I so far have tried the named non-contiguous range to no avail but assume there is a clever way to do a countif on the whole array but only when the left most value ="qty"


[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]4[/TD]
[/TR]
[TR]
[TD="align: center"]Time[/TD]
[TD="align: center"]7:24[/TD]
[TD="align: center"]5:18[/TD]
[TD="align: center"]8:32[/TD]
[TD="align: center"]7:12[/TD]
[/TR]
[TR]
[TD="align: center"]Qty[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]43[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]95[/TD]
[/TR]
[TR]
[TD="align: center"]Time[/TD]
[TD="align: center"]6:57[/TD]
[TD="align: center"]7:43[/TD]
[TD="align: center"]7:33[/TD]
[TD="align: center"]5:46[/TD]
[/TR]
[TR]
[TD="align: center"]Qty[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]53[/TD]
[/TR]
[TR]
[TD="align: center"]Time[/TD]
[TD="align: center"]8:11[/TD]
[TD="align: center"]7:32[/TD]
[TD="align: center"]6:42[/TD]
[TD="align: center"]6:03[/TD]
[/TR]
[TR]
[TD="align: center"]Qty[/TD]
[TD="align: center"]91[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]76[/TD]
[TD="align: center"]67[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi and welcome to MrExcel,

see if this helps:


Book1
ABCDEFGH
1Time07:2405:1808:3207:12
2Qty23431495
3Time06:5707:4307:3305:46
4Qty32211753<305
5Time08:1107:3206:4206:03<406
6Qty91247667
Sheet1
Cell Formulas
RangeFormula
H4=SUMPRODUCT(($A$1:$A$6="Qty")*($B$1:$E$6<30))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
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