Two functions in one cell

Thanh

New Member
Joined
Apr 9, 2002
Messages
10
I am trying to incorporate two functions into one cell. I have the day in one column and time in another column

Day Time
14 8:01
14 8:05
14 9:06
15 8:50
15 8:02
16 2:00
16 2:50

e.g I want to find the number of times day 14 occurs between 8:00 and 9:00. The answer I would be looking for is 2 in this case. I have tried putting in the countif function along with "and" to separate the second function, but it doesn't work. Any suggestions?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
{=SUM((A2:A8=14)*(B2:B8>="8:00"+0)*(B2:B8<="9:00"+0))}

Note: This is an array formula which must be entered using the Control+Shift+Enter key combination. The outermost braces, { }, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula.
 
Upvote 0
On 2002-04-10 10:00, Thanh wrote:
I am trying to incorporate two functions into one cell. I have the day in one column and time in another column

Day Time
14 8:01
14 8:05
14 9:06
15 8:50
15 8:02
16 2:00
16 2:50

e.g I want to find the number of times day 14 occurs between 8:00 and 9:00. The answer I would be looking for is 2 in this case. I have tried putting in the countif function along with "and" to separate the second function, but it doesn't work. Any suggestions?


=SUMPRODUCT((B2:B8>=C1)*(B2:A8<=C2)*(A2:A3=C3))

where C1 houses the earlier time, C2 the later time, and C3 the day number.

You can also try DCOUNT:

In D1 enter: Time
In E1 enter: Time
In F1 enter: Day

In D2 enter: >=8:00
In E2 enter: <=9:00
In F2 enter: 14

=DCOUNT(A1:B8,1,D1:F2)

Aladin
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,937
Members
448,534
Latest member
benefuexx

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