Excel Formula Needed

tim220225

New Member
Joined
Jun 4, 2012
Messages
29
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I seem to be stumped trying to assemble a formula. I need to total the mileage run by month from one worksheet to another summary worksheet by the month. Basically I have column A called loaded miles driven and in column B I have deadhead miles driven. Column C has the month and year formatted as Aug-2018 for example. these totals need to be drawn to a second page that looks like a calendar. I would appreciate all suggestions.

Tim
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Difficult to visualize what you want. Suggest you show us a couple of lines of data and then what you want Sheet2 to look like for the data provided.
 
Upvote 0
Difficult to visualize what you want. Suggest you show us a couple of lines of data and then what you want Sheet2 to look like for the data provided.

Thanks for the reply. I would post the workbook but I am not allowed to which makes this difficult. Any suggestions?
 
Upvote 0
Yup. Take a couple of pictures and post them. Insert Image. Keep the amount of data to a minimum.
 
Upvote 0
How does this look? Column A would be Loaded Miles in the first data set and Year in the second set. What I need is for the formula to total the Loaded mileage in column A to the Loaded Mileage row in the second set. Hope this makes sense.



A B C D E F

Loaded MilesDeadhead MilesPick-Up DateDelivery DateYearMonth
2281228/14/20188/14/20182018Aug-18
2542188/15/20188/15/20182018Aug-18
49559/11/20189/11/20182018Sep-18
02539/17/20189/17/20182018Sep-18
8422010/2/201810/2/20182018Oct-18
20320510/8/201810/9/20182018Oct-18
101910/12/201810/12/20182018Oct-18

<tbody>
</tbody>



A B C D E F G H I J K L M N O
YearMileage TypeJan-18Feb-18Mar-18Apr-18May-18Jun-18Jul-18Aug-18Sep-18Oct-18Nov-18Dec-18YTD
2018Loaded Miles0
Deadhead Miles
Total

<tbody>
</tbody>
 
Last edited:
Upvote 0
Here's one way.
Copy formulas across columns.

Excel Workbook
ABCDEFGHIJKLMNO
1YearMileage Type18-Jan18-Feb18-Mar18-Apr18-May18-Jun18-Jul18-Aug18-Sep18-Oct18-Nov18-DecYTD
22018Loaded Miles00000004824929700828
3Deadhead Miles0000000340308444001092
4Total0000000822357741001920
Sheet2
Excel Workbook
ABCDEF
1Loaded MilesDeadhead MilesPick-Up DateDelivery DateYearMonth
22281228/14/20188/14/2018201818-Aug
32542188/15/20188/15/2018201818-Aug
449559/11/20189/11/2018201818-Sep
502539/17/20189/17/2018201818-Sep
68422010/2/201810/2/2018201818-Oct
720320510/8/201810/9/2018201818-Oct
8101910/12/201810/12/2018201818-Oct
Sheet1
 
Upvote 0
Here's one way.
Copy formulas across columns.

Sheet2

ABCDEFGHIJKLMNO
1YearMileage Type18-Jan18-Feb18-Mar18-Apr18-May18-Jun18-Jul18-Aug18-Sep18-Oct18-Nov18-DecYTD
22018Loaded Miles00000004824929700828
3 Deadhead Miles0000000340308444001092
4 Total0000000822357741001920

<colgroup><col style="width:30px; "><col style="width:80px;"><col style="width:121px;"><col style="width:79px;"><col style="width:75px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
C2=SUMPRODUCT(--(MONTH(C$1)=MONTH(Sheet1!$F$2:$F$8)),--(YEAR(C$1)=YEAR(Sheet1!$F$2:$F$8)),Sheet1!$A$2:$A$8)
C3=SUMPRODUCT(--(MONTH(C$1)=MONTH(Sheet1!$F$2:$F$8)),--(YEAR(C$1)=YEAR(Sheet1!$F$2:$F$8)),Sheet1!$B$2:$B$8)

<tbody>
</tbody>

<tbody>
</tbody>


Sheet1

ABCDEF
1Loaded MilesDeadhead MilesPick-Up DateDelivery DateYearMonth
22281228/14/20188/14/2018201818-Aug
32542188/15/20188/15/2018201818-Aug
449559/11/20189/11/2018201818-Sep
502539/17/20189/17/2018201818-Sep
68422010/2/201810/2/2018201818-Oct
720320510/8/201810/9/2018201818-Oct
8101910/12/201810/12/2018201818-Oct

<colgroup><col style="width:30px; "><col style="width:97px;"><col style="width:116px;"><col style="width:104px;"><col style="width:108px;"><col style="width:77px;"><col style="width:75px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

This has worked great so far, thank you! I forgot to mention that the year 2018 on Sheet 2 cell A2 is fluid. When I change the year then cell C1 on sheet 2 will update to the month and year, 17-Jan for example. This allows me to review an entire year at a glance and compare the data to a different year. This is needed because the mileage and dates on sheet 1 includes multiple years. How can the formula be changed to accommodate this?
 
Upvote 0
Formula should still work. It's pulling the year and month that shows in cells C1 to N1. If the year changes to 2017 then the formula will look for 2017 on sheet1.
 
Upvote 0
I tried changing the dates and the formula works for me.

Excel Workbook
ABCDEFGHIJKLMNO
1YearMileage Type17-Jan17-Feb17-Mar17-Apr17-May17-Jun17-Jul17-Aug17-Sep17-Oct17-Nov17-DecYTD
22017Loaded Miles0000000000100300400
3Deadhead Miles00000000005075125
4Total0000000000150375525
Sheet2


Excel Workbook
ABCDEFGHIJKLMNO
1YearMileage Type18-Jan18-Feb18-Mar18-Apr18-May18-Jun18-Jul18-Aug18-Sep18-Oct18-Nov18-DecYTD
22018Loaded Miles00000004824929700828
3Deadhead Miles0000000340308444001092
4Total0000000822357741001920
Sheet2
Excel Workbook
ABCDEF
1Loaded MilesDeadhead MilesPick-Up DateDelivery DateYearMonth
22281228/14/20188/14/2018201818-Aug
32542188/15/20188/15/2018201818-Aug
449559/11/20189/11/2018201818-Sep
502539/17/20189/17/2018201818-Sep
68422010/2/201810/2/2018201818-Oct
720320510/8/201810/9/2018201818-Oct
8101910/12/201810/12/2018201818-Oct
91005011/12/201711/12/2017201712-Nov
103007512/2/201712/4/201720174-Dec
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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