Trying to get total mileage for a specific month

  • Thread starter Thread starter big_chief_hutch
  • Start date Start date
B

big_chief_hutch

I have a spreadsheet which shows the date and mileage of business journeys. I
am trying to create a function that will for each month pick out the mileages
for that month and total them up.

Tried the following: =SUMIF(A19:A64,">=01/04/2006",G19:G64) where the A
column is the dates and the G column are the mileages, but I cant seem to set
up an upper limit for the dates. ie Apr journeys only, etc

Help

Big Chief
 
Try this:

Total mileage for Jan 2007:
=SUMPRODUCT(TEXT(A19:A64,"YYYYMM"="200701")*G19:G64)

Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
Ron

Sorry, still coming up with error message. The SUMIF function I used below
did total everything after 1st Apr 06 ok, but I couldn't put in an upper date
limit. I also tried using the MONTH function within it and also tried a
further less than 1st May 06, but always got an error message

Keith
 
Oops! Typo! (sorry)

Try working with this:
=SUMPRODUCT((TEXT(A19:A64,"YYYYMM")="200701")*G19:G64)

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
Ron

Excellent - working a treat. Also seen this in another post, but yours I
prefer.

=SUMPRODUCT(--(MONTH(A19:A64)=10),--(YEAR(A19:A64)=2006),G19:G64)

Many thanks for all the help

Keith
 
I'm glad I could help, Keith.

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 

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

Back
Top