Need Help In Making a Dynamic Formula in LibreOffice/Excel - excel-2007

I need help making a dynamic formula and I'm not sure how to do it. Here is my structure.
A4=1
B4=0
C4=1
D4=SUM(A4+B4+C4)
H4=(A4-C4)/D4*100
Now we come to cell J4. What I need J4 to do is this: If H4 is less than 78%, I want it to tell me how many more I need in cell A4 to show a value of 78% or higher in cell H4. This is a Sample Formula I have, but it's not correct.
=IF(H4>=0.78,"You 're fine","You Need "&INT((SUM(A4:C4)*0.78+H4)/0.22)&" to get to 78%")

Try this:
=IF(H4>=78,"OK",CONCATENATE("You need ",INT((A4/H4)*(100+H4))," to get to your goal"))
Test Values:
A4=100
B4=0
C4=56
Sums:
D4= 156
H4=28

Maybe this would suit:
=IF(H4<78,"You Need "&ROUNDUP((89*C4+39*B4)/11-A4,2)&" to get to 78%","You're fine")

Related

Adding various number of dots in excel

I have a lot of excel files looking like that:
Example:
My goal is to make it look like that:
To do that, I used very simple excel's function:
=F7&" "&G7&".........cat."&" "&H7&" times "&I7&CHAR(10)&F8&" "&G8&".........cat."&" "&H8&" times "&I8&CHAR(10)
The thing is, the number of dots placed before "cat" is not constant. It depends where the previous sentence ends and my formula doesn't take it into account - it always adds 9 dots, which means I have to add the rest of the dots manually.
Any ideas how to make it work? :D
The REPT function can do this. Use LEN to calculate the length of what you're adding the dots to, then subtract that from the desired width of the result. That will repeat the dot enough times to fill the column. For example, if you want the text with dots to be 40 characters, right padded with .:
=F1&" "&G1&REPT(".",40-LEN(G1))&"cat."&" "&H1&" times "&I1&CHAR(10)&F2&""
=LEFT(A1 & REPT(".",22-LEN(A1))&"cat",25)
22 = fixed width - len("cat"), 25 - fixed width.
edit - i revised because my original answer was not correct but I see Comintern has posted a similar response since.

How to scan a column for a certain word and when triggered, remove the first 4 characters

Hey everyone so here is my setup
My issue is regarding the "C" column and how to remove the "2nd|" and "3rd|" portions so it ONLY shows "Mikes Auto Shop" "Carls Auto Repair" etc
Like this
Just a formula in D2 will do the trick
=RIGHT(C2,LEN(C2)-4)
https://www.mrexcel.com/forum/excel-questions/375502-remove-first-letter-each-cell-column.html
on the forum here they mention that you can use =RIGHT(A1,LEN(A1)-1), for you it would look more like =RIGHT(C1,LEN(C1)-1) and you would place it in the D column and then just grap the bottom right hand corner and drag it down the will give you all the values you need in the D column, hope this helps
If there is only sometimes a prefix or if it can be larger than 9, you can use:
=RIGHT(C2,LEN(C2)-IFERROR(FIND("|",C2),0))

sum+sum equation issue in GAMS

I defined the following equation to calculate the sum of total power consumed by the system:
TotalPower.. systemPower =e= sum(J,P(J)) + sum(I,CP(I));
However, the variable systemPower gets only the result of the second sum and not both!. The declaration of P(J) is as following:
P.LO(I)=0;
P.up(I)=100;
P.l('i1')=2;
P.l('i2')=3;
Please, Can any one explain why I get the result of a single sum? How I can do to get both?. I tried also to separate them in different values but yet I get the same result.
Thank you in advance.
I though it is a good idea to share this it might help someone else. I used a variable directly instead of an equation and I put it in the following form and it worked.
systemPower.l = sum(I,P.l(I))+sum(I,CP(I));

SSRS- Conditional formatting with Percents and numbers

In my mind this should be easy.. I have spent a good bit of time trying to get this right
Problem-
I have 1 data set that returns whole numbers as well as percents. What I am looking for is a formatting step to work and add the correct suffix (x100+% when % or nothing)
Here is what I have but don't get consistent results
=iif(Fields!Mid_Size.Value<1,Format(Fields!Mid_Size.Value,"P"),Format(Fields!Mid_Size.Value,"#"))
The raw data looks like:
Alpha Mid-Size
11 49
0.0718954248366013 0.320261437908497
Anyone have any ideas?
Try this:
=iif(Fields!Mid_Size.Value<1,FormatPercent(Fields!Mid_Size.Value,0),Format(Fields!Mid_Size.Value,"#"))
This uses the FormatPercent function. The '0' is for no decimal places; you can set that to however many you want.

Excel sum two non-adjacent cells ignoring NA error

This is really simple, but I can't find the correct solution.
I have two cells A1 and D1 that I need to add together, however one or both of them may contain NA errors (to prevent plotting on a graph). I need to find the total of these two cells, or if one is NA it must return the non-NA value :
eg : 100+NA=100 or NA+100=100 or 100+100=200
I have tried =SUMIF(Range_1,"<>#NA") but as this is not a range I can't get the right answer and I have tried combinations of if(iserror formula with no success... help !!
Good thing that you found a solution yourself.
An even easier way (IMHO - from a legibility point of view) might be to use
=IFERROR(A1; 0) + IFERROR(D1; 0)
This way you still perform a simple addition operation, but include the required conditionality.
IFERROR() is a convenience function that combines the functionality of the IF() function and the ISERROR() function; it avoids having to state the same formula twice when using only the IF() function.
I found the =IFNA formula to work faster.
In your example, it would be =IFNA(A1,D1) - if A1 is not NA it'll return the value, otherwise will return D1. It means that if both A1 and D1 are NA, that will be the output.
Hope this helps!