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.
Related
I am trying to find the formula on excel that will solve my problem.
I need to calculate X, which is equivalent to a percentage YĆ·2 (and X has maximum and minimum values which depend on Y)
We have that if Y is less than 500, X represents 25% of Y. In this case, X must take a value between 5 and 125.
If Y is between 500 and 1000, X represents 20% of Y. In this case, X must take a value between 125 and 200.
If Y is greater than 1000, X represents 15% of Y. In this case, X must take a value between 200 and 400.
In order to find the value of X based on the value of Y, I first used this formula (omitting the max and min values)
Y=A2
=IF(A2<500; A2*0,125; IF(A2<=1000; A2*0,1; IF(A2>1000; A2*0,075)))
Now I tried to incorporate in my formula the min and max and that's where I'm stuck
For the first part of the problem (Y<500), I applied this formula:
=MAX((IF(A2<500;A2*0,125));5)
Ideally I would have realized this formula:
=MAX((IF(A2<500; A2*0,125));5) ; MAX((IF(A2<=1000; A2*0,1));125) ; MAX((IF(A2>1000; A2*0,075));200)
But since I can't do it (Excel won't let me), would you have any alternatives to offer me?
Do you want to determine the percentage based on the value but set a minimum?
=IF(A2<500,MAX(A2*0.125,5),IF(A2<=1000,MAX(A2*0.1,125),MAX(A2*0.075,200)))
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.
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")
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:
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).