Countifs that will not count formulas that return ""

Liz_I3

Well-known Member
Joined
Dec 30, 2002
Messages
647
Office Version
  1. 2016
Platform
  1. Windows
Hello
On sheet(Data) I have a Column of Name (G) and a Column of Dates (B). Column F is a concatenation of the 2 columns G&B ( Name and Date Joined to use as a lookup field)

On Sheet1 I have a Column of Dates (A) and Column of Names (B) I wanted a formula in Column C that would count the Number of Items on Sheet(Data) column K where on Sheet(Data) Column F matched the concatenation of Columns B&A on Sheet1.

I used this formula =COUNTIFS(DATA!F:F,B2&A2,DATA!K:K,"<>") but DataK is a formula that has iferror "" so my Countifs returns the count of the formulas not just if a value is returned (which is this case is a time) Is there a way to change this not to count the formula so if the formula is a blank or "" it is not counted

This formula work =SUMPRODUCT((DATA!K:K<>"")*(DATA!K:K<>0)) but it counts all the non "" cells in column K I could not get it to count just one persons name and particular date

I was trying the sumproduct =SUMPRODUCT(--(DATA!F2:F6000=B2&A2),DATA!K2:K6000) but keep getting NA

Thanks
L
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Try
=COUNTIFS(DATA!F:F,B2&A2,DATA!K:K,"><")
 
Upvote 0
That returned 0. Answer should be 8

Thanks for trying
L
 
Upvote 0
In that case can you please post some sample data using the XL2BB add-in?
 
Upvote 0
Book1
ABCDEFGHIJKLM
1Sheet1Sheet(DATA)
2DateNameCount of Column M (SheetDATA)Message Date/TimeDateTimeCard #LKUP ValueNameINOutTime In
31/13/20Kai11/13/20 6:39:10 AM1/13/206:39293323Kai43843KaiIN6:39
41/13/20John11/13/20 3:01:11 PM1/13/2015:01293323Kai43843KaiOUT 
51/13/20Liz11/14/20 3:47:13 PM1/14/2015:47293323Kai43844KaiIN15:47
61/14/20Kai11/13/20 5:25:16 PM1/13/2017:25293323Kai43843KaiOUT 
71/14/20John11/13/20 10:16:14 AM1/13/2010:16276157John43843JohnIN10:16
81/14/20Liz11/13/20 10:17:20 AM1/13/2010:17276157John43843JohnOUT 
91/14/20 10:20:23 AM1/14/2010:20276157John43844JohnIN10:20
101/14/20 1:03:50 PM1/14/2013:03276157John43844JohnOUT 
111/13/20 1:29:06 PM1/13/2013:29276157Liz43843LizIN13:29
121/13/20 1:35:07 PM1/13/2013:35276157Liz43843LizOUT 
131/14/20 1:37:54 PM1/14/2013:37276157Liz43844LizIN13:37
Sheet2
Cell Formulas
RangeFormula
F3:F13F3=INT(E3)
G3:G13G3=E3-F3
I3:I13I3=J3&F3
M3:M13M3=IF(K3="IN",G3,"")
 
Upvote 0
Which cells is the formula meant to be looking at? There are no IfError functions in what you've shown.
 
Upvote 0
Hi
Column M Time In. I want to count the number of times entered for each person. But the column is a formula, so it is counting each row including the formulas instead of just the values i.e. for Kai there are 2 entries for Jan 13/20 but he only has 1 Time In but any formulas I have return 2 what I want is 1.

Thanks
L
 
Upvote 0
In that case how about
Book1
ABCDEFGHIJKLM
1Sheet1Sheet(DATA)
2DateNameCount of Column M (SheetDATA)Message Date/TimeDateTimeCard #LKUP ValueNameINOutTime In
313/01/2020Kai113/01/2020 06:39:10438430.277199074293323Kai43843KaiIN0.277199074
413/01/2020John113/01/2020 15:01:11438430.625821759293323Kai43843KaiOUT 
513/01/2020Liz114/01/2020 15:47:13438440.657789352293323Kai43844KaiIN0.657789352
614/01/2020Kai113/01/2020 17:25:16438430.72587963293323Kai43843KaiOUT 
714/01/2020John113/01/2020 10:16:14438430.427939815276157John43843JohnIN0.427939815
814/01/2020Liz113/01/2020 10:17:20438430.428703704276157John43843JohnOUT 
914/01/2020 10:20:23438440.430821759276157John43844JohnIN0.430821759
1014/01/2020 13:03:50438440.544328704276157John43844JohnOUT 
1113/01/2020 13:29:06438430.561875276157Liz43843LizIN0.561875
1213/01/2020 13:35:07438430.566053241276157Liz43843LizOUT 
1314/01/2020 13:37:54438440.567986111276157Liz43844LizIN0.567986111
25
Cell Formulas
RangeFormula
F3:F13F3=INT(E3)
G3:G13G3=E3-F3
C3:C8C3=COUNTIFS(I:I,B3&A3,M:M,">0")
I3:I13I3=J3&F3
M3:M13M3=IF(K3="IN",G3,"")
 
Upvote 0
OMG That is fabulous...works perfect
Thank you so much...I played with it for hours

Liz
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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