How do I define multiple formulas in excel? - excel

I have no idea if this is the right place to ask this, but I am really struggling with excel. I am trying to define two formulas in excel, and then make a 2 variable data table to run these formulas through.
My formulas are:
Q = SQRT( 2*U*A ) / SQRT(h) , and if you use that best quantity Q then the acquisition and holding costs yield a corresponding TOTAL COST = SQRT( 2*U*A ) * SQRT(h).
We are then given a range of values for U and h, with A constant.
How do I define these equations in excel?

Here's a start, type this in (without the A B C... and 1,2,3... at top):
A B C D E
1 A U h Q Total
2 123 1 100 =SQRT(2*B2*$A$2)/SQRT(C2) =SQRT(2*B2*$A$2)*SQRT(C2)
3 2 200 =SQRT(2*B3*$A$2)/SQRT(C3) =SQRT(2*B3*$A$2)*SQRT(C3)
4 3 300 =SQRT(2*B4*$A$2)/SQRT(C4) =SQRT(2*B4*$A$2)*SQRT(C4)
Also, have a look at https://faculty.fuqua.duke.edu/~pecklund/ExcelReview/2001_Documents/2001XLGettingStarted.pdf

Related

VLookup with Multiple Ranges

I'm trying to make a formula that would do the following: There are say 10 categories 1-10, given a number x and y, the line is in category 3 if and only if x is between 1 and 2 and y is between 5-7 for example. I don't know how to use VLookup given the multiple conditions and the two ranges that are completely different and not in a sequential order.
I tried using index match:
=INDEX(B5:B15,MATCH(1,IF(AND(K5>=C5:C15,K5<=D5:D15),1,0)*IF(AND(L5>=E5:E15,L5<=F5:F15),1,0),0))
but this returns an error where column B are the categories, K5 and L5 are x and y respectively and column C is the lower bounds for x per category with D as upper bounds and same for E and F for y.
Here's a mock representation of the data and rules:
Data
x y category
1.2 12 1
1.5 5 2
0.98 23 3
.
.
.
Rules
Category X-LB X-UB Y-LB Y-UB
1 1 2 9 15
2 1.5 1.7 1 9
3 0.8 1 20 23
.
.
.
LB is lower bound and UB is upper bound. For example given x and y above using the rules table we find the expected return column.
Thank you,
If you have only category which will fit the bill in each case, one way is to use SUMPRODUCT.
Formula in C2 and down is
=SUMPRODUCT(($B$10:$B$12<=A2)*($C$10:$C$12>=A2)*($D$10:$D$12<=B2)*($E$10:$E$12>=B2)*($A$10:$A$12))
In M5, copied down :
=INDEX($B$5:$B$15,MATCH(1,INDEX(($K5>=$C$5:$C$15)*($K5<=$D$5:$D$15)*($L5>=$E$5:$E$15)*($L5<=$F$5:$F$15),0),0))
Or,
Another shorter option.
Using SUMIFS function, formula in M5 copied down :
=SUMIFS($B:$B,$C:$C,"<="&$K5,$D:$D,">="&$K5,$E:$E,"<="&$L5,$F:$F,">="&$L5)

Distributing data with lower and upper boundaries in Excel

Here's a link to a screenshot with the formula used in Column B and some sample data
I have a spreadsheet with 48 rows of data in column A
The values range from 0 to 19
The average of these 48 rows = 8.71
the standard deviation of the population = 3.77
I've used the STANDARDIZE function in excel in column B to return the Z-score of each item in column A given that I know the mean (8.71), std dev (3.77), and x (whatever is in column A).
For example (row 2) has:
x = 2
z = -1.779
Using the z value, I want to create an lower (4) and upper (24) boundary and calculate what the value would be in this 3rd column.
Essentially, if x = 0 (min value), then z = -2.3096, and columnC = 4 (lower boundary condition)
Conversely, if x = 19 (max value), then z = 2.9947, and columnC = 19 (upper boundary condition)
and then all other values between 0 to 19 would be calculated....
Any ideas how I can accomplish this with a formula in the column C?
So if your lowest original value is 0 and your highest is 19 and you want to re-distribute them from 4 to 24 and we assume that both are linear that means:
Since both are linear we have to use these formulas:
we develope the first to c so we get
and replace the c in the second equation with that so we get
and develope this to m as follows
If we put this togeter with our third equation above we get:
So we finally have equations for m = and c = and we can use the numbers from our old and new lower and upper bound to get:
you can use these values with
where x is are your old values in column A and y is the new distributed value in column B:
Some visualization if you change the boundaries:
Idea for a non-linear solution
If you want 4 and 24 as boundaries and the mean should be 12 the solution cannot be linear of course. But you could use for example any other formula like
So you can use this formula for column D y2 with the following values a, b, c as well as calculating the mean, min and max over column D y2.
Then use the solver:
Goal is: Mean $M$15 should be 12
secondary conditions: $M$16 = 4 (lower boundary) and $M$17 = 24 (upper boundary)
variable cells are a, b and c: $M$11:$M$13
The solver will now adjust the values a, b and c so that you get very close to your goal and to get these results:
The min is 4 the max is almost 24 and the mean is almost 12 that is probably the closest you can get with a numeric method.

Making multiple copies of a cell and duplicating it for a list

I have a list of different names that I would like to duplicate each one by 3 copies of itself. For instance:
A
B
C
D
E
to the following:
A
A
A
B
B
B
C
C
C
D
D
D
E
E
E
How I would I accomplish this in excel? Can it be done in Excel?
There are SOOO many ways to do this... One way would be using something along the lines of the OFFSET() function like so:
Supposing your original list was in cells A1:A5, say. You could then put this formula where you want it:
=OFFSET($A$1,ROUNDDOWN((ROW(A1)-1)/5,0),0)
and drag it down for the 25 rows you want.
In essence, what you're saying is:
Offset cell A1 by ROUNDDOWN((ROW(A1)-1)/5,0) rows and 0 columns.
Looking at that ROUNDDOWN() function:
Row(A1) = 1 (Similarly, Row(A2) = 2, etc...
(Row(A1)-1) / 5 = 0/5 ; 1/5 ; 2/5 ; .....
Rounddowwn(...) means 0/5 to 4/5 becomes 0 ; 5/5 to 9/5 becomes 1 ; etc
Therefore, it will offset A1 by 0 rows and 0 columns 5 times then by 1 row and 0 columns for the next 5, etc.
Hope that makes sense :)
EDIT:
The original question asked for 3 copies of each value, not 5 - I'm leaving the answer as-is purposefully with this edit so someone else can see how to change it to any number of repetitions as wanted... All that would change would be:
=OFFSET($A$1,ROUNDDOWN((ROW(A1)-1)/3,0),0)
Simply, divide by 3 rather than 5 for that to occur...

How to sum constants if the values of a row contian a specific value in excel?

I have the following row in excel:
12 4 12p 12a 12b
I need to sum this elements with their values from the legend.
12 = 12;
4 = 4;
12p = 12,5;
12a = 12,2;
12b = 12,3;
For example
=12 + 4 + 12,5 + 12,2 + 12,3
Any ideas?
If you have all the elements within one cell as a single string of text, the optimal approach would be to start by using text-to-column to split them up. So you'll have 12 in A, 4 in B, 12p in C, 12a in D, 12b in E. If that's not an option, I can show you string manipulations that can be an alternative.
You'll need to turn your "legend" into a look-up table, (perhaps on sheet2?), with column A having: p, a, b, etc.. and column B having the relative values.
Once that's done, place this formula on sheet1, in F column:
=A2+IFERROR(VLOOKUP(RIGHT(A2),Sheet2!$A:$B,2,FALSE),0)
Then drag it to the right 5 times, and it will have the values of the elements "translated".
You can sum the translated range easily.

agregate in vertical 2 or more colums in EXCEL

I'm looking for a way to take these columns (Name/value)..
Name Value Name Value
a 1 c 3
b 2 d 4
and join them together as follows:
Name Value
a 1
b 2
c 3
d 4
Thanks
A PivotTable constructed with multiple consolidation ranges (one for each pair) would achieve the result you want (but might be little easier that copy and paste):

Resources