Sample Data
This data shows time in hours and speed in kilometers per hour for a car trip.
| Cell | Value |
|---|---|
| A1 | Time (hours) |
| B1 | Speed (km/h) |
| A2 | 1 |
| B2 | 60 |
| A3 | 2 |
| B3 | 70 |
| A4 | 3 |
| B4 | 80 |
Jump into concepts and practice - no test required
This data shows time in hours and speed in kilometers per hour for a car trip.
| Cell | Value |
|---|---|
| A1 | Time (hours) |
| B1 | Speed (km/h) |
| A2 | 1 |
| B2 | 60 |
| A3 | 2 |
| B3 | 70 |
| A4 | 3 |
| B4 | 80 |
=SUMPRODUCT(B2:B3, A3:A4 - A2:A3)A B 1 Time Speed 2 1 60 3 2 70 4 3 80 References: - B2:B3 speeds for intervals - A3:A4 and A2:A3 for time differences
A B C 1 Time Speed Distance 2 1 60 3 2 70 4 3 80 130 Cell C4 shows total distance = 130 km
SUMPRODUCT function do in Google Sheets?SUMPRODUCT multiplies elements from two or more arrays element-wise.A1:A3 = {2, 3, 4}B1:B3 = {5, 6, 7}=SUMPRODUCT(A1:A3, B1:B3)?=SUMPRODUCT(A1:A3, B1:B2) but get an error. What is the problem?A1:A4 = {10, 15, 20, 25} and hours worked in B1:B4 = {2, 3, 1, 4}. Which formula calculates total earnings correctly?