I am helping my son with his math homework, specifically statistics and this is the dataset:
1 2 3 4 5 6 7 8 9 10
I have 10 numbers from 1 to 10.
15 percentile:
in Excel I use the PERCENTILE or PERCENTILE.INC function with .15 and the result is 2.35, why?
The book way. .15*10 = 1.5 th number. There is not 1.5 number so round up to 2 or 2.
20 percentile:
In excel I get 2.8.
Book version: .2*10 = 2 (exact) so take average of 2nd and 3rd value for 2.5
50 percentile or median:
In excel I get 5.5.
Book version .5*10 = 5 (exact) so take average of 5th and 6th value for 5.5 (only match)
75 percentile 7.75:
Book, .75*10 * 7.5 so round up to 8.
Excel
80 percentile:
Excel I get 8.2
Book, .8108, average of 8 and 9 is 8.5.
Obviously Excel is doing more advanced math and additional smoothing, however I have not been able to find the exact math it uses replicate it, hence I will say it is wrong. Other programs and statistical packages match Excel so it is correct, but not useful as I need it.
How can I get Excel to give me the Book version of answers or at least replicate the Excel answers with paper and a basic calculator.
Most importantly I need to find a way to explain to my son that it is OK that the results don't match that he should do it the book way, at least for now or in school.
EDIT: After posting, SO found and similar question: Different results for percentiles in SAS and Excel It seems SAS gives the same results as the book version. The answer there is that Excel and most packages use different interpolation methods. However I need a better explanation for my son and maybe a way to create a proper percentile function for my son, but hopefully without VBA.
Related
First of all I'd like to make it clear, that I'm a total newbie to MDX and only grasp the absolute basics. I'll do my very best to try and describe my issue, and hope that some of you guys have time to help me. If it's to much to ask for, I totally understand, but not putting my question out there wouldn't get me anywhere either way, right.
I'm working with and Excel Olap Pivot table, and I'm looking to create a new MDX measure that multiplies the sum of expenditure in each of the last five years by a factor, like in the example below:
Year
Expediture
Factor
2018
100.000
1.05
2019
100.000
1.04
2019
100.000
1.03
2020
100.000
1.02
2021
100.000
1.01
I have an Excel Olap Pivot table with the measure [Measures].[Expected Expenditure] and the dimension [Date].[Year].[Year]). The dimension "[Date].[Year].[Year])" also holds data for other years than the five years I need to weight the expenditure in. The Factor is a set number and I'm looking to hard-code that into the calculation.
How do I go about creating a new MDX measure that weights the expenditure in each of the five years, but doesn't add a weight to the expenditure in the years outside the scope?
Please let me know if the above description is deficient or if there's anything I need to clarify further. English is not my native tongue and I apologize for anything incoherent writing.
Best regards,
Magnus
So I ran about 200 agent-based model runs and I want to see how the average is changing over time.
For example if we have 10 points
2 4 2 8 6 5 9 8 1 3
I want to calculate the average as the number of points changes
(2+4)/ 2 = 3
now for the next point it will be (3+2)/2 = 2.5
so I can plot each average and see after how many runs does the average stabilize. Something like this image < https://imgur.com/a/VXeeuxy > Can someone provide an equation or method?
Thank you
I think you just want a 'cumulative average' of 1,2..n points. You can do this in a single formula if you don't mind using offset:
In most versions of Excel (F1):
=SUBTOTAL(1,OFFSET(B23,0,0,1,COLUMN(B23:K23)-COLUMN(A23)))
In Excel 365 only (F2):
=SUBTOTAL(1,OFFSET(B23,0,0,1,SEQUENCE(1,COLUMNS(B23:K23))))
Or a more dynamic version that works for a whole row (F3):
=SUBTOTAL(1,OFFSET(B23,0,0,1,COLUMN(A1:INDEX(1:1,COUNT(23:23)))))
and (F4)
=SUBTOTAL(1,OFFSET(B23,0,0,1,SEQUENCE(1,COUNT(23:23))))
So I'm trying to build a spreadsheet to keep track of my working hours. But to make it more "automated" I need additional features. One of them is being able to treat specific strings as numbers, and use them in a formula.
Lets say that I'm John in the following example. I have 160 hours in paid vacation left, and I have manage to build pretty large chunk of paid flex time. Normal working hours is between 8-17. If I come in at work at 7 and leave at 17, I get +1 flex hour.
If I want to use my flextime I can in this case type -8. And the formula in I5 would be =SUM(C4:G4) to sum this week/month/year what ever. And the final result, this weeks usage subtracted with the total (J5) =B6+I5.
But, what if I want to use my vacation time? In this example I want VT to be equal to -8 hours as well, but subtracted from the vacation time total. Im using Excel version 16.27 on MacOs.
The formula is : =COUNTIF(C4:G4,"VT")*8
I4 = =COUNTIF(C4:G4,"VT")*-8
I5 = =SUM(C4:G4)
J4 = =B5+I4
J5 = =B6+I5
I have the following table (for example)
Product Quantity Price
A 20 3
B 3 2
A -10 3.1
A -3 3.2
B -1 2.2
Data is shown in time ascending sort and quantity which is negative means it is sold and if positive is bought amount.
What I want to do is to calculate realized and unrealized profit or loss for each product using "First in First out" method.
I tried a lot to write it with sumproduct combined with an array function but it does not work properly.
As I am really new in Excel world I would kindly ask you to give any hint how I can proceed further.
Bestie,
Jeyhun
I already have a spreadsheet set up for 23 salespeople. Row 24 is their customer service index averages. So across the top in B through X I have the salespeople. Their total scores in Row 22 and their averages in Row 24. I would like to rank their average (descending order) in Row 24. Excluding zeros.
Here is what I have come up with (in B28):
=IF(B24=0,"",IF(B24="x",COUNTIFS(B$24:X$24,">"&X24,X$24:X$24,"<>0",B$24:X$24,"x")+1,""))
it won't work.
Any help would be greatly appreciated. I am a quadriplegic running my own business, and any help I can get to not have to add/multiply/subtract/ divide would be a great thing!
Please try this instead:
=IF(B24=0,"",RANK(B24,$B$24:$X$24))
and copy across to suit.
If you're Excel 2010 or newer you can use the RANK.EQ() function. See http://office.microsoft.com/en-us/excel-help/rank-eq-function-HP010335687.aspx?CTT=5&origin=HP010335659 for usage.
Assuming you want to rank then in a descending order (higher numbers rank first), you can use the following:
In B28:
=IF(B24=0,"",RANK.EQ(B24,$B$24:$X$24))
Then just copy across to X28.
UseRANK() if you're using Excel 2007 or older.
Referring to the use of RANK() in Excel 2010 or newer, the Microsoft documentation states the following:
IMPORTANT This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. Although this function is still available for backward compatibility, you should consider using the new functions from now on, because this function may not be available in future versions of Excel.
I added more of the salespeople scores and had no more DIV/0 errors online 24 and low and behold, row 26 all filled in correctly. It was trying to calculate the 0 cells on line 24, in which there was 3 DIV/0, and they came up with a DIV/0 error all the way across row 26. Now if I can just figure out how to get it to put a 0 in their.