Formula if "C" is empty - excel

For now I have this formula:
d = abs(b-c) * a
Here is the example:
=abs(0,8894-0,8291)*10000
The result is 603.
Now, I'm trying to find c, Here is what I do so far:
c = abs(b*a)/d
How can I achieve it?

What you are looking for, is the "solver" feature of Excel. Be aware this is a numerical method, which works with approximation, and therefore can have accuracy issues.

Related

Syntax for average if with OR and AND statements (example in body of Q)

I've come across an issue with AVERAGEIFS formula where they are unable to complete OR and AND simultaneously.
I'm working with data in the format below. I have one consistent criteria, in this example is "DF" in Column B. I have alternative criteria which can also be correct, "Dog*" or "Cat*" in Column A. In column C is the Cuteness Level.
Therefore, I am trying to work out the average cuteness level of Dogs and Cats with Vet Code DF with an Average If formula.
I've tried the following which doesn't work;
=AVERAGE(IF(OR(AND(A2:A17="Cat*",B2:B17="DF"),AND(A2:A17="Dog*",B2:B17="DF")),C2:C17, FALSE))
Can anyone please explain where I am going wrong?
Average IF
I couldn't figure out AVERAGEIFS with multiple wildcard conditions, but you can try something like:
= AVERAGE( IF( OR(Left(A2:A17,3)="Cat", Left(A2:A17,3)="Dog") * (B2:B17="DF"), C2:C17 ) )

Summing a Product in Excel, over the same parameters

I've been struggling with something in excel which is quite easy to do individual cases of using an array, but I want to do in a single cell.
Effectively, in row C I have the multipliers I need, lets call them i_k, for j from 1 to n. The equation I want to calculate in mathematical notation is;
Sigma(from j = 0 to n) (Pi(from k = j to n) (i_k))
But I'm not quite sure how best to go about this. Effectively it should be;
(i_1)^n + (i_2)^(n-1) + (i_3)^(n-2) + ...
In the end. Any help?
I dont know if this is an elegant solution but I think this might solve it for you.
The key is to make a table so that your formulas continue.
The screenshot I have taken explains the formula I have used with its explanation I have used on top of it.
-- The first column will have the intended values of I
-- The second column's first row will have the value of N
-- The third column will have a formula which says:
=IF(ISNUMBER([#[Values of N]]),[#[Values of N]],C2-1)
This will give you the decreasing value of N
Now just multiply N with I on the 4th column using a simple multiplication and add the final result:

Creation of vector of unknown size in Excel

I am attempting to translate my existing Matlab code into Numbers (basically Excel). In Matlab, I have the following code:
clear all; clc;
n = 30
x = 1:(n-1)
T = 295;
D = T./(n-x)
E = T/n
for i=1:(n-2)
C(i) = D(i+1) - D(i)
end
hold on
plot(x(1:end-1), C, 'rx')
plot(x, D, 'bx')
I believe everything has been solved by your formulas, there are parts of them that I don't understand otherwise I would try to figure the rest out myself. Attached is the result (Also you might like to know that the formulas you gave work and are recognized in Numbers). Im trying to figure out why (x) begins at 2 as I feel as though it should start at 1?
Also it is clear that the realistic results for the formulas only exist under certain conditions i.e. column E > 0. That being the case, what would be the easiest way to chart data with a filter so that only certain data is charted?
(Using Excel...)
Suppose you put your input values T & n in A1 & B1 respectively.
You could generate x, D & C In columns C,D & E with:
C1: =IF(ROW()<$A$1,ROW(),"")
D1: =IF(LEN(C1)>0,$A$2/($A$1-C1),"")
E1: =IF(LEN(D2)>0,D2-D1,"")
You could then pull all 3 columns down as far as you need to generate the full length of your vectors. If you then want to chart these, simply use these columns as inputs.

VLOOKUP not finding value in array

I used VLOOKUP function to find a value in an array but some of the values gave #N/A answer despite of available in array.
To round up the numbers, I used CEILING function but interesting point is in some values, it did not work.
I checked the type of value if it is number or not.
Also, I used ROUNDUP function but did not work.
Also, I tried INDEX/MATCH combination and again did not work.
In the example that I gave in the link, when I type between 15.00 - 15.20, it gives error but trying other values, it works.
How do I fix this?
This seems to be a bug with VLOOKUP and MATCH using the return values of CEILING. If you use:
=VLOOKUP(ROUND(CEILING(F4,0.1),1),A:B,2,FALSE)
then it works as expected.
If we look at this with VBA then we see what happens. To blame should be really CEILING and ROUNDUP. See example:
Sub testCeilingAndRoundup()
Dim v As Double, test As Boolean, diff As Double
v = [CEILING(15.1,0.1)] '15.1
test = (v = 15.1) 'FALSE
diff = 15.1 - v '-1.776...E-15
v = [ROUNDUP(15.25,1)] '15.3
test = (v = 15.3) 'FALSE
diff = 15.3 - v '1.776...E-15
End Sub
Looks like you've run into an Excel bug.
Applying CEILING to the number 15.1 should return the exact same result (15.1) regardless of whether the significance is 0.1, 0.01, 0.001, etc.
And indeed it does, according to Excel: when asked if they're equal, the answer is always TRUE.
But looking up these mathematically equal numbers in the look-up table gives different results.
This has to be a bug.
Instead of CEILING(F4,0.1), I suggest you use ROUNDUP(F4,1) which appears to be bug-free. Nope, ROUNDUP is buggy as well. Axel Richter's answer suggests wrapping CEILING in a ROUND and this does appear to make the problem go away. You can also convert to string and back to number:
VALUE(TEXT(ROUNDUP(F4,1),"0.0"))
so you'd have
=VLOOKUP(VALUE(TEXT(ROUNDUP(F4,1),"0.0")),A:B,2,FALSE)
Your CEILING function should be more precise if you want to find a match for 15.10
Change it to CEILING(F4,0.01) and it will works :)

Using MS Excel to simulate a formula using a variable?

I'm very confused on how to use Microsoft Excel to simulate a "problem", but I've been assured that it's possible.
I have the equation
v(t) = (mg/c)(1-e^((-c/m)(t)))
And I know the values of m, g, k, and c.
m = 170
g = 32 ft/s^2
k = 2.5 lb/ft
c = 1.2 lb/ft/s
So my formula changes into
v(t) = (170*32/1.2)(1-e^((-1.2/170)(t)))
v(t) = (453.33)(1-e^((-.00705)(t)))
The problem is about a bungee jumper, and this is one function that I should use to find velocity, and another that is used for x (distance), but if I can learn how to properly implement this one, I should be able to easily figure out the other one.
I need to somehow implement this in Excel, as a spreadsheet simulation. I have no idea how to implement this in Excel, and I don't know the formulas to do it. I know I could just go through the formula manually and just substitute variables in for t (i.e., .5, 1, 1.5, 2, 2.5, ...), but I know there's supposed to be some way for Excel to do it for me. Additionally, I'm not sure how to simplify the powers and the "e" in my formula, and I actually don't know if I need it if I can just sub in variables like I think I can. Any help would be greatly appreciated.
EDIT: The other state equation, x(t), is below
x(t) = (mg/c)(t) + ((m^2 * g) / c^2))e^((-c/m)(t) - (m^2 * g / c^2))
This formula as mentioned in the OP:
v(t) = (453.33)(1-e^((-.00705)(t)))
needs a little adaptation, as suggested by #Tim Williams, to be suitable for Excel:
=453.33*(1-EXP(-.00705*t)
Excel does not multiply letters by numbers but will attempt to interpret t above as a named range (which may contain one or more numbers) before objecting. So t may be the name given to a range starting .5 and stepping .5 up to and including 10 (may easily be created with Fill , Series…).
If the above formula is then placed in the same row as 0.5 and copied down to suit the results should be as required.
It may however be worth noting that naming a range as a single letter is not best practice and for accuracy, convenience and versatility the constants (eg re gravity) and the variables (eg mass) would be better fed as parameters to the formula.

Resources