Complex IF Formula Not Working

dhunton

New Member
Joined
Apr 14, 2016
Messages
48
I have a spreadsheet where I cannot use macros or VBA, so I am limited to formulas.

I have a list of times and days of the week.

I need to count the number of rows where the number in column D is not below 00:15:00 and this works:
= countif(D:D,">=00:15:00")

I also need to find the highest number in row D in the rows where the weekday (in column F) is the same as shown in a nearby cell (H25). This works:
= {max(if(F:F=H25,D:D,""))}
NOTE that the {} show that the internal "if" statement returns an array from which the max calculates

Now, I need to find the number of rows where the number in column D is not below 00:15:00 AND the weekday in column F is the same as shown in a nearby cell (H25).

I thought this would work:
={countif((if(F:F=H25,D:D,"")), ">=00:15:00")}

The thinking was that the internal "if" statement is the same as in the max formula above, so it would return an array, which the countif could use to check against the ">=00:15:00" that works in the first "countif" statement.

But it doesn't work. Any help would be appreciated.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Book1
ABCDEFGH
12000:15:00Monday
200:29:0000:16:00Tuesday
3300:17:00Wednesday
400:14:00Thursday
500:19:00Friday
600:05:00Saturday
700:05:00Sunday
800:29:00Monday
900:23:00Tuesday
1000:55:00Wednesday
1100:12:00Thursday
1200:56:00Friday
1300:34:00Saturday
1400:56:00Sunday
1500:22:00Monday
1600:21:00Tuesday
1700:55:00Wednesday
1800:09:00Thursday
1900:19:00Friday
2000:28:00Saturday
2100:26:00Sunday
2200:13:00Monday
2300:46:00Tuesday
2400:50:00Wednesday
2500:53:00ThursdayMonday
2600:09:00Friday
2700:02:00Saturday
2800:29:00Sunday
Sheet1
Cell Formulas
RangeFormula
A1=COUNTIF($D:$D,">="&TIME(0,15,0))
A2{=MAX(IF($F:$F=$H$25,$D:$D))}
A3{=SUM(IF($F:$F=$H$25,IF($D:$D>=TIME(0,15,0),1,0),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.


WBD
 
Upvote 0
If you're using Excel 2016 you also have this instead of the array formula:

Code:
=MAXIFS($D:$D,$F:$F,$H$25)

WBD
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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