Gathering information by year

Thomas Comtois

New Member
Joined
Sep 4, 2019
Messages
3
I have a excel vehicle tracking system that uses log sheets entered by trip that has a date associated with each entry. This includes kilometers driven for that date and for what vehicle. I have the ability to change the year and month on a report tab that will produce the kilometers per vehicle with that particular year and month. I would like to get the same kilometer information for a entire year not just one month but have not found a formula that works yet. This is my first posting on this forum so i'm sure my terminology is a little weird. If uploading a screen shot would be helpful can I do that here?
Thanks for the help
Thomas
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi, welcome to the forums!

Maybe something like this?

ABCDEF
1Distance (KM)DateVehicleYearly KM2019
288.701/04/2019Audi TTAudi TT143.8
3109.209/05/2019Vauxhall AstraVauxhall Astra288.7
455.115/06/2019Audi TT
5179.501/09/2019Vauxhall Astra

<tbody>
</tbody>

Where F2 is given by the formula (and then dragged down Col F)

=SUMPRODUCT((YEAR($B$2:$B$5)=$F$1)*(E2=$C$2:$C$5)*($A$2:$A$5))

This formula says to look at the date and match it against 2019 in F1, then to match the car model in column E to the vehicle data in col C, and finally return the sum of the distances in column A that adhere to the first 2 conditions.
 
Upvote 0
Thank you tyija1995
this worked great for my basic report thank you very much but I have one that is a lot more complicated but needing the same yearly information.
I will try to describe it the best I can. I have a table with a tab called vehicle input this is where I enter data that has columns for date, vehicle name, kilometers driven, fuel purchased. I have a report tab that has two cells one for the year and one for the month that I can change the month and year to give me the information on the vehicle input tab. If I change the either the year or the month the information from the tab called vehicle is gathered and entered into my report tab accordingly. I want to the whole years information not just the month in that year. Here is the formula used to get the monthly information
=DATE(F8,MONTH(DATEVALUE(H8&" 1"))*1,1)
=DATE(F8,MONTH(DATEVALUE(H8&" 1 ))+1,1)-1
I don't know if this will make sense to you but I appreciate your trying to help
 
Upvote 0
Hi,

I assume those two formulas you wrote result in the start and end date of a given month? (month in cell H8)

They can be rewritten as
=DATE(F8,MONTH("1/"&H8),1) for first day of month
=DATE(F8,MONTH("1/"&H8)+1,1)-1 for last day of month OR you could just put =EOMONTH(*reference first formula cell*, 0)

But if you want the entire year (say 2019) can you just do =DATE(F8, 1, 1) and =DATE(F8, 12, 31)

From there it's hard to see what you need to do - I would probably need a screenshot or something to work with, someone else might be able to go further though!
 
Upvote 0
tyija1995
I dont know if my last message got thru before I lost internet but thank you for all your help both of them work like a charm. I appreciate your help greatly
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

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