How to "dual and" sumif function

hometech99

New Member
Joined
Jan 14, 2004
Messages
8
I have a list of driving miles. i get re-imbursed for over 41 miles per day at a certain rate.

now, i have each leg of a trip per row in a spreadsheet (date, start mi, end mi, length, destination, car).
i ran the subtotal to show me how many miles per day i drove.
so, for each day, i have a row that shows the date, the word "Total", and, under the length coulmn, the toal miles for the day.

NOW, i need to take that subtotal LENGTH data, and for each LENGTH subtotal thats over 41 miles, i need to total all those "over 41" miles up.

thanks
 
if you have a total miles, can't you do something like:

=total miles - (41*(countif(range.selection,">41"))

??

maybe i'm not following either.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
got it.
the Fill handle (bottom right).

perfect.

at the end of each subtotal line, i have a column thats JUST the miles OVER 41 for the day.

now just to total and calculate.

thanks for walking me through.

best regards
 
Upvote 0
Thanks Brian,

i got that part.
what i needed was something that ran that function ONLY on the subtotal rows
(so, looking for over 41 miles per DAY, NOT per leg of the trip).

so, since the Starting mileage cell (column B) is blank in the subtotal rows (the subtotal row only has the date and the word "Total" in Column A, and the total for the day in column D, all i ended up doing is:

IF(B1="",IF(D1>41,D1-41,""),"")


now, every third row (the Subtotal row created by Excel), has a column that has the Over 41/day miles in it.

at the bottom of the sheet, i just totalled that column, multiplied by mileage reimbursement, and im done.




best regards
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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