SUMIF

S

Sasikiran

Dear,

I am struglling with a formula to get the sum of the values if it satisfies
with the given conditions.

In column F, I have the values which are to be summed if it fall under a
required date and within the specified time.
In column G, I have the date
In column H, the time

I have values till row number 4000

I am trying with SUMPRODUCT formula but not getting the desired result.

sumproduct((G2:G4000=--"3/3/2009")*(H2:H4000>=--"10:00:00")*(H2:H4000<=--"10:29:59")*

The sum value of the numbers in column F if
G2:G4000 is "3/3/2009"
H2:H4000>=-"10:00:00"
H2:H4000<="10:29:59"

Please help.
 
S

Stefi

Not tested, but try this
=sumproduct(--((G2:G4000=datevalue("3/3/2009")),--(H2:H4000>=timevalue("10:00:00")),--(H2:H4000<=timevalue("10:29:59")),F2:F4000)
Regards,
Stefi

„Sasikiran†ezt írta:
 
S

Sasikiran

This is not working...
When i tried copy pasting, It says the formula you typed contains an error.

Please help.
 
S

Stefi

Yes there was a redundant ( in it, this is the fixed version:

=sumproduct(--(G2:G4000=datevalue("3/3/2009")),--(H2:H4000>=timevalue("10:00:00")),--(H2:H4000<=timevalue("10:29:59")),F2:F4000)
Stefi

„Sasikiran†ezt írta:
 
B

Bob Phillips

Stefi,

Just to add to the pot, I would use

=SUMPRODUCT(--(G2:G4000=--"2009-03-03"),--(H2:H4000>=--"10:00:00"),--(H2:H4000<--"10:30:00"),F2:F4000)

I think those small changes are more robuts and make it easier to read.
 
S

Sasikiran

Thanks a ton stefi... :)


Stefi said:
Yes there was a redundant ( in it, this is the fixed version:

=sumproduct(--(G2:G4000=datevalue("3/3/2009")),--(H2:H4000>=timevalue("10:00:00")),--(H2:H4000<=timevalue("10:29:59")),F2:F4000)
Stefi

„Sasikiran†ezt írta:
 
S

Stefi

Thanks Bob, one can always learn new things! I didn't know that
=--"2009-03-03" is equivalent with DATEVALUE("2009-03-03").

Stefi

„Bob Phillips†ezt írta:
 
S

Stefi

You are welcome! Thanks for the feedback!
Clicking the YES button will be appreciated.

Stefi

„Sasikiran†ezt írta:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top