Excel Finding average speed - excel

I have got 1500 rows of travels. In column A I have got total time on travel, in column B total km driven. In column C I did calculation on the average speed of specific travel. Whats the best way to calculate the average speed of all travels? The lengths are from 0 to 20 kms approx, time always shorter than one hour.
First I eliminated all travels shorter than 2 km then
I managed to do a frequency table and have written frequencies of speeds in 0-5,5-10,... km/h. Now I can do a histogram, but should I eliminate more data or how to approach this problem?

In another cell enter:
=SUM(B:B)/SUM(A:A)
A common error would be to try to average the values in column C.

it depends on your data. if it is statistics, don't throw data away, use them.
you have column A for travel time, and column B for travle distance. using this two column you can find the total average speed like what Gary's student suggest i.e. SUM(B:B)/SUM(A:A).
you also have column C the average speed for each travel, you can use this two counter check. simply do SUMPRODUCT(A:A,C:C), you should find the result equals to SUM(B:B). if the results match, then i'll say "ok i'm satisfied with my calculation".

Related

Number of days for delivery and number of orders delivered in two separate columns. Is there a way to get summary statistics about orders?

I've had a bit of trouble explaining this so please bear with me. I'm also very new to using excel so if there's a simple fix, I apologize in advance!
I have two columns, one listing number of days starting from 0 and increasing consecutively. The other column has the number of orders delivered. The two correspond to each other. For example, I've typed out how it would look below. It would mean that there were 100 orders delivered in 1 day, 150 orders delivered in 2 days, 800 orders delivered in 3 days, etc.
Is there a way to get summary statistics (mean, median, mode, upper and lower quartiles) for the number of days it took for the average order to get delivered? The only way I can think of solving this is to manually punch in "1" 100 times, "2" 150 times, etc. into a new column and take median, mean, and upper & lower quartile from that, but that seems extremely inefficient. Would I use a pivot table for this? Thank you in advance!
I tried using the data analysis add-on and doing summary statistics that way, but it didn't work. It just gave me the mean, median, mode, and quartiles of each individual column. It would have given me 3 for median number of days for delivery and 300 for median number of orders.
Method 1
The mean is just
=SUMPRODUCT(A2:A6,B2:B6)/SUM(B2:B6)
Mode is the value with highest frequency
=INDEX(A2:A6,MATCH(MAX(B2:B6),B2:B6,0))
The quartiles and median (or any other quantile by varying the value of p) from first principles following this reference
=LET(p,0.25,
values,A2:A6,
freq,B2:B6,
N,SUM(freq),
h,(N+1)*p,
floorh,FLOOR(h,1),
ceilh,CEILING(h,1),
frac,h-floorh,
cusum,SCAN(0,SEQUENCE(ROWS(values)),LAMBDA(a,c,IF(c=1,0,a+INDEX(freq,c-1)))),
xlower,XLOOKUP(floorh-1,cusum,values,,-1),
xupper,XLOOKUP(ceilh-1,cusum,values,,-1),
xlower+(xupper-xlower)*frac)
Method 2
If you don't like doing it this way, you can always expand the data like this:
=AVERAGE(XLOOKUP(SEQUENCE(SUM(B2:B6),1,0),SCAN(0,SEQUENCE(ROWS(A2:A6)),LAMBDA(a,c,IF(c=1,0,INDEX(B2:B6,c-1)+a))),A2:A6,,-1))
=MODE(XLOOKUP(SEQUENCE(SUM(B2:B6),1,0),SCAN(0,SEQUENCE(ROWS(A2:A6)),LAMBDA(a,c,IF(c=1,0,INDEX(B2:B6,c-1)+a))),A2:A6,,-1))
=QUARTILE.EXC(XLOOKUP(SEQUENCE(SUM(B2:B6),1,0),SCAN(0,SEQUENCE(ROWS(A2:A6)),LAMBDA(a,c,IF(c=1,0,INDEX(B2:B6,c-1)+a))),A2:A6,,-1),1)
=MEDIAN(XLOOKUP(SEQUENCE(SUM(B2:B6),1,0),SCAN(0,SEQUENCE(ROWS(A2:A6)),LAMBDA(a,c,IF(c=1,0,INDEX(B2:B6,c-1)+a))),A2:A6,,-1))
and
=QUARTILE.EXC(XLOOKUP(SEQUENCE(SUM(B2:B6),1,0),SCAN(0,SEQUENCE(ROWS(A2:A6)),LAMBDA(a,c,IF(c=1,0,INDEX(B2:B6,c-1)+a))),A2:A6,,-1),3)

Calculate Average from Groups

I'm trying to take a table of web data (average % of page viewed) and create an average.
This is what my table looks like:
0-25% 954,353
26-50% 58,569
76-100% 73,653
51-75% 31,011
I'm looking to calculate in a cell that the average across all is XX %.
I guess this is what you are looking for:
Due to a lack of more information, we do not know what the actual distribution of the items in the range from 0 - 25% is. Hence, I am assuming that they all average out at 12,5% (the median). If you continue this line of thought then the overall average is nothing but an average of the medians or (looking at the formula) a SumProduct divided by the Sum of all items.

Calculating an average rate based on multiple columns

I'm trying to calculate an average fare rate per square metre. To do this, I want to calculate the total cost by multiplying the Quantity (col E), the Footprint (col Q) and the netcon objective per square metre (col AI) to get the total cost per line item, adding all these up, then dividing by the total footprint (E*Q) for the whole list (lines 4 to 503, most of which are generally blank).
Since I want to avoid any more helper columns, I'm hoping to find a one-cell solution. To that end, I tried building an array formula:
=($E$4:$E$503*$Q$4:$Q$503*$AI$4:$AI$503)/SUM($E$4:$E$503*$Q$4:$Q$503)
It gives a #VALUE! error, though, and since it's my first attempt at actually writing an array formula rather than just copy-pasting one I'm not sure where I'm going wrong.
Any ideas?
IF you are interested in avoiding an array formula this looks like a sumproduct operation. You could try this:
=sumproduct($E$4:$E$503,$Q$4:$Q$503,$AI$4:$AI$503)/sumproduct($E$4:$E$503,$Q$4:$Q$503)
and for your original formula, were you missing SUM at the start?
=sum($E$4:$E$503*$Q$4:$Q$503*$AI$4:$AI$503)/SUM($E$4:$E$503*$Q$4:$Q$503)

I'm trying to calculate the average with multiple columns (days and firms) and rows

I'm currently trying to calculate the following:
That is, the average daily sales of a firm. The example underneath is small, but in reality I have 280 days and over a 100 firms. I've tried with VLOOKUP(firmname A, (cells), sales) but it obviously only brings back one number. Sum(Vlookup) is also not the best of choice.
Anyone who could point me in the right direction ... SUMIF?
http://i66.tinypic.com/2wmnrbn.png
Assuming data is located at B2:C11 and the list of Firms is at F2:F5 enter this formula in G3 and copy till last record
=AVERAGEIFS($D$3:$D$11,$C$3:$C$11,$F3)

Excel Formulae needed to calculate weight loss

Myself and some friends are taking part in a weight loss challenge this year and I will be recording monthly weigh in's and body measurements. I need to find a calculation which will work out the difference's in inches and pounds.
I have the item title in column B from row 10 down to Row 17. The first one in Row 10 is weight which is calculated in pounds.
Then going across from Column C is the month starting with Jan ending in December in Column N.
The total loss needs to be updated after every monthly entry into column O.
Unfortunately I cannot post a picture of the table as I'm new to this group.
I've tried other formulaes suggested to people with similar problems but they don't work for me.
Can anyone help?
Many Thanks
Helen
Bit hard to work it out from your description but I think you are looking for
=C10-MIN(D10:N10)
That assumes the largest figure will always be in column C and will update every time a new entry is placed in the row.
If the weight might go up (not that you are going to fail the challenge) you could use
=C10 - LOOKUP(1,1/(D10:N10<>""),D10:N10)
This should do the trick. (And you can copy down to other rows as necessary)
=INDEX(C10:N10,1,COUNT(C10:N10))-C10
INDEX used here, returns the value from the range C10:N10 in the first and only row, where the column is determined by the count of values already entered. So if you have values entered for 4 months, the formula will take April's value and subtract January's value.
A negative number will represent weight loss. A positive number means weight gain.
Total fat loss :
(AVERAGE(C10:N10) - C10)*2

Resources