Trying to get sumif to work with dates

  • Thread starter Thread starter Stapes
  • Start date Start date
S

Stapes

Hi

I am using trying to use the formula shown below, but not getting a
result when I should.

=SUMIF('MERSEY RAIL'!A6:'MERSEY RAIL'!A100,">=M2",'MERSEY RAIL'!
C6:'MERSEY RAIL'!C100)

If I put <>, I get a figure, but it is wrong because some of the dates
do match.

However, ideally I want it to do ">=M2 AND <=M3".

Is this possible with SUMIF?

Stapes
 
Try it in this form
=SUMIF('Another sheet'!A6:A100,"<>"&M2,'Another sheet'!C1:C5)
Note: (A) the way the criteria is set up and (B) the range reference need
the sheet name just once in each case.
best wishes
 
You could revise your formula like this:

=SUMIF('MERSEY RAIL'!A6:A100,">=M2",'MERSEY RAIL'!C6:C100)

To include two or more criteria you should use SUMPRODUCT (or
SUM(IF( ... ) ) as an array formula):

=SUMPRODUCT(('MERSEY RAIL'!A6:A100>=M2)*('MERSEY RAIL'!
A6:A100<=M3)*'MERSY RAIL'!C6:C100))

All one formula - be wary of spurious line breaks on the newsgroups.

Hope this helps.

Pete
 
Back
Top