Sumifs or nested ands

RkGen

New Member
Joined
Aug 31, 2010
Messages
12
Good morning:
I work for a trucking company and have several years worth of load & payroll data.

The data is contained in 2 tables.
Table 1 columns are: date, truck, driver, load, miles
Table 2 columns are: week start, week end, driver, cost.

Each driver can do multiple loads per day and what I'm trying to do is create a way to figure a labor cost per truck either by load or by day. The end result is to combine the data with 3 other tables in a power pivot controlled by a timeline to get a cost per day per truck. the 3 other tables are typical trucking expenses and are formatted: date, truck, driver, expense.

I've tried a couple variations of sumifs as well as multiple ands but either get an error or return value of zero.

Any assistance would be greatly appreciated.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
PowerPivot ... SumIFS...??
Make sure you have your relationship created and CALCULATE !
Its all about the Measures.

YouTube channels from Mike Girvin "ExcelIsFun" and Bill Jelen "MrExcel".
Mike for the long and thorough, Bill for the Quick.
Matt Allington, Rob Collie and Marco Russo(w Alberto Ferrari) have several good books on squeezing out the advantages of PowerPivot and DAX.
 
Last edited:
Upvote 0
I've watched a few of the videos which I though would relate.
Power pivots & relationships between tables is relatively new to me however, I have it working as it relates to tables that represent pure truck info (fuel, Tolls, Repairs etc).
The issue that I'm running into is that drivers move between trucks and their payroll costs vary from week to week so I'm having difficulty relating back to the truck to arrive at a cost per truck.
My initial thought was to calculate a rate per mile for each driver based on the specific week and multiply it for each load. From there, it's relatively straight forward. The problem is devising a formula to do that. That's where the sumifs or nested ands came in.
I'm not sure my approach is even feasible but I'll keep plugging away and will figure it out eventually. I was hoping someone could point me in the right direction and save me some time and a lot of frustration.
Thanks
 
Upvote 0
I've gone through many tutorials on sumifs, have worked the formula multiple times, multiple ways and keep coming up with zero values. There obviously something wrong with my logic or my thought process.

Below are examples of the 2 tables.

Labor Table
Pay DateHome Department CodeDriverRegular Pay Rate AmountTotal HoursTotal GrossFICAHealth ins401(k) EmployerTripTelephoneHSAHealth InsuranceW/CTotal CostDateEnd DateMiles
09/14/20182Driver 1 9/2/20189/8/20180.00
09/14/20182Driver 2 9/2/20189/8/20180.00
09/14/20182Driver 3 9/2/20189/8/20180.00
09/14/20182Driver 4 9/2/20189/8/20180.00

<colgroup><col><col><col span="12"><col><col span="3"></colgroup><tbody>
</tbody>

Detail Table
TruckDriverCustomerDateTrip#Load#OriginationDestination2EmptyLoadedTotalRevenue
Driver 1 9/7/2018 218322 OH CT97.7745.1842.8
Driver 2 9/7/2018 218310 WV MA279.5502.4781.9
Driver 3 9/7/2018 218193 ME GA01276.51276.5
Driver 4 9/7/2018 218265 KY ME82.21156.51238.7

<colgroup><col><col><col span="12"></colgroup><tbody>
</tbody>

and here is the formula: =SUMIFS(Detail[Total],Detail[Driver],Labor[@Driver],Detail[Date],">=Labor[@[Date]]",Detail[Date],"<=Labor[@[End Date]]")

I'm trying to calculate how many miles a driver has run in any particular week to use in another formula elsewhere in the spreadsheet.

Date & End date on the labor table are actually formulas based on the paydate. Not sure if it matters but figured I'd mention it.

If someone could point out where the issue resides, it would be greatly appreciated.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,071
Latest member
cdnMech

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