Plotting Number of Events that Occur in an Interval Histogram - excel

In Excel, I have two fields per row, a start date/time and an end date/time. I am looking to plot a histogram that shows how many of the rows' intervals contain the time on the x axis.
For example, some start and end times could be: [1,3], [3,4], [7,9], and [7,8]
And I want an output similar to:
x x x
x x x x x x x
1.2.3.4.5.6.7.8.9
How can this be done?

One way is to split your tuples (say with Text to Columns) into say ColumnsA:B, starting in Row3 (say to Row6) and series filling D1:L9 (or to suit) with D1 = 1 and an integer increase.
Then in D3 copied across to L3 and D3:L3 copied down to Row6:
=IF(AND(D$1>=$A3,D$1<=$B3),"X","")
and in D2 copied across to L2:
=COUNTIF(D3:D6,"X")
Then make a column chart (INSERT > Charts) from D1:L2.
However, I may have misunderstood because there is no particular time significance to the above - the data is just treated like integers.

Related

How to create a table from grid data with independant axes

I need to create a table (either pivot or normal) that combines data laid out in this grid:
The grid shows the count of items by their size, broken down by width on one axis and height on the other. I can't figure out a way to correlate the sizes with the data. The only way I have gotten it to work so far is by manually creating table rows one by one using formulas that reference each cell.
For example, the table should read like this:
Size
Count
3 X 3
0
3 X 4
0
3 X 6
20
I'm eventually going to use this table to create a Pareto chart, but if I can create the chart from this grid that would work too.
If you can get columns K and L below to show your distinct combinations, which shouldn't take more than several minutes, then the rest is pretty easy.
Column M is simply concatenating your results to show your data how you desire.
M2 formula: =CONCAT(K2, " x ", L2)
Then column N is using a formula against your data, referencing your values in columns K and L.
N2 formula: =INDEX($A$1:$H$8,MATCH(K2,$A$1:$H$1,0),MATCH(L2,$A$1:$A$8,0))
Drag 'em down and that's it.

Excel: Totaling where value is X or Y

I've got an excel spreadsheet where one of the values is X or Y. I want a function to add up the amounts column for all the Xs then the same for all the Ys. So in the example below, the calculation for all Xs would be 1080 and all Ys 1100.
X/Y: Amount
X : 500
Y : 600
X : 580
Y : 500
I'd then like to be able to calculate the mean and median of that figure, so for the mean, take the total of the Xs (1080) and divide by the number of cells with X (2). I don't know how to do this bit either.
Thanks in advance!
So lets assume you have the X and Y in Col A with the values in Col B.
We could use the following formula for the Sum of X:
=SUMIF(A1:A4,"X",B1:B4)
We could use the following formula for the Sum of Y:
=SUMIF(A1:A4,"Y",B1:B4)
As for the Mean we take the above formala and divide by countif like this:
=SUMIF(A1:A4,"X",B1:B4)/COUNTIF(A1:A4,"X")
=SUMIF(A1:A4,"Y",B1:B4)/COUNTIF(A1:A4,"Y")

Excel - Multiply Until Total Reached

I want to multiply x*y until x>=20, then multiply z that value and have the results displayed as two values, the multiple and multiple*z
The question behind the formula is, how many boxes of x capacity do I need to have a total capacity of 20 liters and how much does that cost.
x = volume of bottle
y = number of bottles in a box
z = price per box
This could be done very easily by hand, but I've been playing (with little effect) in excel for a while and would like a solution.
I hope that makes sense
I rather think what you would like is the formula provided by #Jeeped but for:
I want to multiply x*y until x>=20, then multiply z that value and have the results displayed as two values, the multiple and multiple*z
label two arrays from 1 to 20 for columns and rows as shown, populate V1 with the price per box and in B2:
=IF(AND($A2*B$1>20,A2>=20),"",$A2*B$1)
and in X2:
=IF(B2="","",$V$1*B2)
with both formulae copied across 19 columns and those two sets of 20 formulae then copied down 19 rows. The result should be similar to:

combining information that meet criteria in one excel cell

I have to combine data that meet certain criteria. the background is: I have a list with parts for a car that has different model series (in this example X,Y,Z). One partnumber can appear multiple times in the list with different model series. I have to know which part is used in which model series.
for example my existing excel table looks like this:
partnumber Model series
100 X
100 Y
100 X
100 Z
200 Z
200 Y
300 X
400 Y
400 Z
afterwards it should look like this:
partnumber Model series usage
100 X X,Y,Z
100 Y X,Y,Z
100 X X,Y,Z
100 Z X,Y,Z
200 Z Y,Z
200 Y Y,Z
300 X X
400 Y X,Y
400 X X,Y
400 Y X,Y
Is there a formula to do that or do I need VBA? It would be great if I could use a formula for that issue.
thank you very much!
You cannot do this with a regular worksheet formula, but if you include the VBA function from here:
http://www.cpearson.com/excel/stringconcatenation.aspx
Then you can use this formula:
=StringConcat(",", IF($A$2:$A$10=A2,$B$2:$B$10,""))
Where "partnumber" is in A2:A10, "model series" is in B2:B10, and the formula is entered in C2 (using Ctrl+Shift+Enter since it's an array formula) and filled down.

How do I perform a monte carlo simulation in Open Office?

I am trying to generate some ranges for a problem I am working on. These rangers are going to be based on the sum of the ratio's of a bunch of numbers. So for example, the constant's are 5 6 and 7.
The ranges I get will be 5/x + 6/y + 7/z = S
I want x, y, and z to come out of a list of numbers I have - say .5, .6, .7, .8, .9, and 1
So If I run 100 iterations of this, I want the spreadsheet to randomly fill a value in X from that list of numbers, another random selection for y, and yet another for z.
And like I said, I want that sum, S, to be calculated 100 times in such a way that I will get a range of values for S.
I have been trying to figure out how to do this without the use of macros.
Here's one way to do it. Create a table of x, y, and z input values. Put a column to the left of the table with the number of each input value (1...N). Say that you have 10 potential input values for each. So your table is in A1:D10 with 1 through 10 in column A and the x values in B, y values in C, and z valued in D.
Then you can select a random value of the x values by writing =VLOOKUP(10*RAND()+1,$A$1:$D$10,2,TRUE). This randomly selects a number between 0 and 10 and looks up the x value matching the A column that matches the number, rounded down. E.g. the random number is 4.3 -- then it will select the 4th value. Replace the third parameter in the VLOOKUP column with 3 for y values and 4 for z values...
If you don't have any other data in columns A:D, you can generalize this with =VLOOKUP(count($A:$A)*RAND()+1,$A:$D,2,TRUE).

Resources