close
Hi and Happy New Year to all

I need a formula (and don't know where to start) for the following

In a worksheet I have a list of dates in column A and times in column B, I
want a formula to count each time a certain date and time before 12noon
appear in columns A and B, and likewise the amount of times a certain date
and time appear after 12noon.

eg, basic worksheet

A B
1Jan 11:23
1Jan 13:34
2Jan 09:10
2Jan 11:34
2Jan 15:43

so the result for 01Jan before 1200 would be 1, the result for 01Jan after
1200 would also be 1, the result for 02Jan before 1200 would be 2, and so on.

I think think this could be solved using 'arrays' in the =SUMPRODUCT formula
but I don't know how to write the formula

Appreciate any help

Kind regards
AnthonyDepending on how many dates you are dealing with, you may want to utilize a
Pivot table. Before doing so add a formula to each row that returns quot;Before
Noonquot; and quot;After Noonquot;, then use that calculated column as the Pivot Table's
column headers. Put the dates in the row headers area, and then use a count
of the dates for the data values
quot;Anthonyquot; wrote:

gt; Hi and Happy New Year to all
gt;
gt; I need a formula (and don't know where to start) for the following
gt;
gt; In a worksheet I have a list of dates in column A and times in column B, I
gt; want a formula to count each time a certain date and time before 12noon
gt; appear in columns A and B, and likewise the amount of times a certain date
gt; and time appear after 12noon.
gt;
gt; eg, basic worksheet
gt;
gt; A B
gt; 1Jan 11:23
gt; 1Jan 13:34
gt; 2Jan 09:10
gt; 2Jan 11:34
gt; 2Jan 15:43
gt;
gt; so the result for 01Jan before 1200 would be 1, the result for 01Jan after
gt; 1200 would also be 1, the result for 02Jan before 1200 would be 2, and so on.
gt;
gt; I think think this could be solved using 'arrays' in the =SUMPRODUCT formula
gt; but I don't know how to write the formula
gt;
gt; Appreciate any help
gt;
gt; Kind regards
gt; Anthony
gt;

=SUMPRODUCT(--($A$1:$A$100=--quot;2006-01-01quot;),--($B$1:$B$100lt;=--quot;12:00quot;))
and
=SUMPRODUCT(--($A$1:$A$100=--quot;2006-01-01quot;),--($B$1:$B$100gt;--quot;12:00quot;))

but better to put the date and time in a cell and test against that

=SUMPRODUCT(--($A$1:$A$100=C1),--($B$1:$B$100lt;=C2))

--

HTH

RP
(remove nothere from the email address if mailing direct)quot;Anthonyquot; gt; wrote in message
...
gt; Hi and Happy New Year to all
gt;
gt; I need a formula (and don't know where to start) for the following
gt;
gt; In a worksheet I have a list of dates in column A and times in column B, I
gt; want a formula to count each time a certain date and time before 12noon
gt; appear in columns A and B, and likewise the amount of times a certain date
gt; and time appear after 12noon.
gt;
gt; eg, basic worksheet
gt;
gt; A B
gt; 1Jan 11:23
gt; 1Jan 13:34
gt; 2Jan 09:10
gt; 2Jan 11:34
gt; 2Jan 15:43
gt;
gt; so the result for 01Jan before 1200 would be 1, the result for 01Jan after
gt; 1200 would also be 1, the result for 02Jan before 1200 would be 2, and so
on.
gt;
gt; I think think this could be solved using 'arrays' in the =SUMPRODUCT
formula
gt; but I don't know how to write the formula
gt;
gt; Appreciate any help
gt;
gt; Kind regards
gt; Anthony
gt;
On Mon, 2 Jan 2006 08:13:02 -0800, quot;Anthonyquot;
gt; wrote:

gt;Hi and Happy New Year to all
gt;
gt;I need a formula (and don't know where to start) for the following
gt;
gt;In a worksheet I have a list of dates in column A and times in column B, I
gt;want a formula to count each time a certain date and time before 12noon
gt;appear in columns A and B, and likewise the amount of times a certain date
gt;and time appear after 12noon.
gt;
gt;eg, basic worksheet
gt;
gt;A B
gt;1Jan 11:23
gt;1Jan 13:34
gt;2Jan 09:10
gt;2Jan 11:34
gt;2Jan 15:43
gt;
gt;so the result for 01Jan before 1200 would be 1, the result for 01Jan after
gt;1200 would also be 1, the result for 02Jan before 1200 would be 2, and so on.
gt;
gt;I think think this could be solved using 'arrays' in the =SUMPRODUCT formula
gt;but I don't know how to write the formula
gt;
gt;Appreciate any help
gt;
gt;Kind regards
gt;Anthony

Given your data in A1:B5

With the date of interest in column D:

D1:1 Jan 2006

Before noon
E1:=SUMPRODUCT(($A$1:$A$5=$D1)*(MOD($B$1:$B$5,1)lt;0.5) )

After noon
F1:=SUMPRODUCT(($A$1:$A$5=$D1)*(MOD($B$1:$B$5,1)gt;=0.5 ))
--ron

arrow
arrow
    全站熱搜

    software 發表在 痞客邦 留言(0) 人氣()