Sumproduct Text and Numbers?

AYouQueTai

Board Regular
Joined
Sep 14, 2019
Messages
50
Office Version
  1. 365
Platform
  1. Windows
Hello,

Cant seem to figure this one out. In my report sheet, In cell B4, I am trying to add a Sumproduct formula that would Check the idle time (Minutes) for the Truck number from B1 and the date in B2.
So I figured =SUMPRODUCT((Data[Vehicle]=$B$1)*(Data[Date]=$B$2)*(Data[Minutes])) would work but it gives me a #Value error. I assume it's because I have this formula =IF(RIGHT(LEFT($D2,2),1)="m",LEFT($D2,1),LEFT($D2,2)) in
my minutes section. I read a few posts and thought this would solve the problem =SUMPRODUCT(--(Data[Vehicle]=$B$1)*(Data[Date]=$B$2)*(Data[Minutes])) but it didn't. Then tried =SUMPRODUCT((Data[Vehicle]=$B$1)*(Data[Date]=$B$2)*(Data[Minutes])*1). Can anyone explain what is happening?

Thanks,

(Samsara)_Idling_Report_.xlsx
ABCDEFGHIJ
1VehicleIdle Event StartIdle Event EndIdle Event DurationPTO StatusFuel UsedAddressDateMinutesSeconds
2Truck 0192024/6/3, 06:562024/6/3, 07:025m 11sInactive0.35Jun-03511
Data
Cell Formulas
RangeFormula
H2H2=IF(RIGHT(LEFT([@[Idle Event Start]],9),1)=",",DATEVALUE(LEFT([@[Idle Event Start]],8)),IF(RIGHT(LEFT([@[Idle Event Start]],10),1)=",",DATEVALUE(LEFT([@[Idle Event Start]],9)),IF(RIGHT(LEFT([@[Idle Event Start]],11),1)=",",DATEVALUE(LEFT([@[Idle Event Start]],10)),"No")))
I2I2=IF(RIGHT(LEFT($D2,2),1)="m",LEFT($D2,1),LEFT($D2,2))
J2J2=IF(LEFT(RIGHT($D2,5),1)="m",MID($D2,3,3),MID($D2,4,1))


(Samsara)_Idling_Report_.xlsx
AB
1TruckTruck 019
2DateJun-03
3
4Idle Time
5Fuel Used
Report
Cells with Data Validation
CellAllowCriteria
B1List=INDIRECT("Trucks")
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
This formula:
Excel Formula:
=IF(RIGHT(LEFT($D2,2),1)="m",LEFT($D2,1),LEFT($D2,2))
while return a Text value, not a numeric one.

If all the characters it returns are numbers, then making this update to it should coerce it to be a number:
Excel Formula:
=IF(RIGHT(LEFT($D2,2),1)="m",LEFT($D2,1),LEFT($D2,2))+0

If you make that change, does your other formula that references this column work?
 
Upvote 1
Solution

Forum statistics

Threads
1,223,881
Messages
6,175,159
Members
452,615
Latest member
bogeys2birdies

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