Formula for Description - excel-formula

I want to interpret my survey data using this interpretation
1.00 – 1.80 – Never
1.81 – 2.60 – Rarely
2.61 - 3.40 - Sometimes
3.41 - 4.20 - Often
4.21 – 5.00 - Always
Please help me with the correct formula if this is possible. Thank You!
I've already tried the IF function but i can't make it work.
=IF(AI3 < 1.80, "Never",
IF(AND(AI3 >=1.81, AI3 < 2.61), "Rarely",
IF(AND(AI3 >=2.61, AI3 < 3.41), "Sometimes" ,
IF(AND(AI3 >=3.41, AI3 <4.21 ), "Rarely"
IF(AI3 >= 4.21, "Always", ""
)
)
)
)
)
)

So, using vlookup() or index() with match(), try this:
Formulae in B2 and B3 are:
=VLOOKUP($A$2,$A$4:$B$8,2,1)
INDEX(B4:B8,MATCH(A2,A4:A8,1))

Related

Matrix calculations using Excel INDIRECT

I would like to run a regression in excel using LINEST function combined with INDIRECT. I need to select the time series between dates and multiply Y and X with an Index before I run the regression.
Date | Y | X | Index
30/06/1990 1.21 2.20 -
30/09/1990 0.73 1.33 -
31/12/1990 -0.07 1.31 -
31/03/1991 1.64 0.80 1.00
30/06/1991 -0.14 0.61 1.00
30/09/1991 4.13 2.37 1.00
31/12/1991 0.71 0.78 1.00
31/03/1992 0.95 0.78 -
30/06/1992 1.61 0.78 -
By using the above data, I need to use the LINEST function from 31/03/1991 until 30/06/1992 but for dates only when the index is 1.
My idea was to use INDIRECT to specify the date range, multiply the LINEST( INDIRECT(Y)*INDIRECT(Index),INDIRECT(X)*INDIRECT(Index),0,0) but I have a error.
Thank you for your help
If the cells in the target range will always be consecutive, try...
H2, confirmed with CONTROL+SHIFT+ENTER:
=SMALL(IF($A$2:$A$10>=F2,IF($A$2:$A$10<=G2,IF($D$2:$D$10=1,ROW($A$2:$A$10)))),1)
I2, confirmed with CONTROL+SHIFT+ENTER:
=LARGE(IF($A$2:$A$10>=F2,IF($A$2:$A$10<=G2,IF($D$2:$D$10=1,ROW($A$2:$A$10)))),1)
J2, confirmed with just ENTER:
=LINEST(INDEX($B:$B,H2):INDEX($B:$B,I2),INDEX($C:$C,H2):INDEX($C:$C,I2),0,0)
Otherwise, try the following instead...
H2, confirmed with CONTROL+SHIFT+ENTER:
=LINEST(N(OFFSET($B$2:$B$10,SMALL(IF($A$2:$A$10>=F2,IF($A$2:$A$10<=G2,IF($D$2:$D$10=1,ROW($B$2:$B$10)-ROW($B$2)))),ROW(INDIRECT("1:"&SUM(IF($A$2:$A$10>=F2,IF($A$2:$A$10<=G2,IF($D$2:$D$10=1,1))))))),0,1)),N(OFFSET($C$2:$C$10,SMALL(IF($A$2:$A$10>=F2,IF($A$2:$A$10<=G2,IF($D$2:$D$10=1,ROW($C$2:$C$10)-ROW($C$2)))),ROW(INDIRECT("1:"&SUM(IF($A$2:$A$10>=F2,IF($A$2:$A$10<=G2,IF($D$2:$D$10=1,1))))))),0,1)),0,0)
However, for Excel 2010 and later, MODE.MULT can be used instead...
H2, confirmed with CONTROL+SHIFT+ENTER:
=LINEST(INDEX($B:$B,N(IF(1,MODE.MULT(IF($A$2:$A$10>=F2,IF($A$2:$A$10<=G2,IF($D$2:$D$10=1,ROW($A$2:$A$10)*{1,1}))))))),INDEX($C:$C,N(IF(1,MODE.MULT(IF($A$2:$A$10>=F2,IF($A$2:$A$10<=G2,IF($D$2:$D$10=1,ROW($A$2:$A$10)*{1,1}))))))),0,0)
Hope this helps!

Excel formula to tell difference between 0.00 and 0

I have a list of numbers that I need to count, however I need to count the 0.00 but not the 0's. For example:
0
0.00
2.85
6.68
1.35
3.27
5.24
5.42
3.32
7.20
0
0
I would need this to count 9 and exclude the three 0's
I have tried using a COUNTIF formula but it seems to be treating the 0.00 and 0 in the same way which isn't giving me the result I need.
Any help would be appreciated as I'm unable to think of any other way around this.
If you format the list of numbers as Text then the COUNTIF formula will respect the difference between 0 and 0.00. See this example below.
Both B1 and E1 have a similar formula:
=COUNTIF(D1:D12,"<>0")
But the range D1:D12 has been given a format of text and so includes the 0.00 therefore giving the answer you want - 9.

Errors when nesting IF() formulas

I'm just putting together a simple spreadsheet that calculates tax owed based on a few different bands. I have an 'Invoiced Amount' cell that takes up the yearly invoicing and then applies a tax rate to it based on the following conditions:
If 'Invoiced Amount' is below 10, 600 then Tax Owed = 0
If 'Invoiced Amount' is above 10, 600 but less than 42, 386 then Tax Owed = ((Invoiced Amount - Tax Allowance)/100) * 20
If 'Invoiced Amount' is Equal to or greater than 42, 386 than Tax Owed = ((42, 386 - Tax Allowance)*20)+((InvoicedAmount - 42, 386)*40)
I could be overlooking something really basic here, but just to be sure - Tax Allowance is 10, 600 - Anything over this up to 42, 386 is worked out at 20% tax, and then anything earn above 42, 386 is charged # 40% on top...
The more I type this out the more confused I am. Anyway, Here is my excel formula:
InvoicedTotal = P5
TaxAllowance (10600) ='UK Tax Figures'!C3
TaxAllowanceUpperBand (42386) ='UK Tax Figures'!G5
TaxAllowance Upper Band - Tax Allowance (31784) = H5
UpperTaxAllownace Band (42386.01) = ='UK Tax Figures'!F5
=IF ((P5)<’UK Tax Figures’!C3, 0, IF(P5>=’UK Tax Figures’!C3<'UK Tax Figures'!G5, ((P5-'UK Tax Figures'!C3)/100)*20, IF(P5>='UK Tax Figures'!F5, ((H5/100)*20)+((P5-'UK Tax Figures'!F5)*40))
At the moment I'm getting crazy unexpected values back, so the calculation is obviously VERY wrong... But I can't see the wood for the trees at the moment, so if anyone has any thoughts I would really appreciate it! Going a little crazy here at the moment!
Putting your formula into the Online Excel Formula beautifier I notice several problems with your formula:
=IF ( ( P5 ) < ’UK Tax Figures’!C3 , 0 ,
IF(
P5 >= ’UK Tax Figures’!C3 < UKTaxFigures!G5,
( ( P5 - UKTaxFigures!C3 ) / 100 ) * 20,
IF(
P5 >= UKTaxFigures!F5,
( ( H5 / 100 ) * 20 ) + ( ( P5 - UKTaxFigures!F5 ) * 40 )
)
First of all, you lack two closing parantheses
Furthermore, you have an invalid conditional in P5>=’UK Tax Figures’!C3<'UK Tax Figures'!G5, you need to change this to AND(P5>=UKTaxFigures!C3;UKTaxFigures!C3<UKTaxFigures!G5).
Taking a look at how you reference your worksheets above, I notice that it seems you have two different sheets - one with spaces between the words in the sheet names, and one without. I suspect this is not the case, so you should probably remove those spaces from the formula.
You are also inconsistent with whether or not you use apostrophes (’) around your sheet-names. Trying out your formula in a cell, Excel didn't seem to like them, so they should probably go as well.
there seems to be a return-value missing from your innermost if-statement if it is false.
Guessing a bit at what you want the formula to return, I end up with this formula:
=IF(P5<UKTaxFigures!C3;0;IF(AND(P5>=UKTaxFigures!C3;UKTaxFigures!C3<UKTaxFigures!G5);((P5-UKTaxFigures!C3)/100)*20;IF(P5>=UKTaxFigures!F5;((H5/100)*20)+((P5-UKTaxFigures!F5)*40);0)))
Which looks like this in the beautifier:
=IF(
P5 < UKTaxFigures!C3;
0;
IF(
AND(
P5 >= UKTaxFigures!C3;
UKTaxFigures!C3 < UKTaxFigures!G5
);
( ( P5 - UKTaxFigures!C3 ) / 100 ) * 20;
IF(
P5 >= UKTaxFigures!F5;
( ( H5 / 100 ) * 20 ) + ( ( P5 - UKTaxFigures!F5 ) * 40 );
0
)
)
)
Is that something close to what you want?
As a final word of advice it is an absolute pain to write a formula like that - instead you can try to build it bit by bit, storing each part of the formula in one cell to see if each of them works. Then you can cut and paste so that they all fit in one cell. I.e. if you in cell A1 store:
=IF(P5>=UKTaxFigures!F5;((H5/100)*20)+((P5-UKTaxFigures!F5)*40);0)
Then you can put
=IF(AND(P5>=UKTaxFigures!C3;UKTaxFigures!C3<UKTaxFigures!G5);((P5-UKTaxFigures!C3)/100)*20;A1)
in A2 and this
=IF(P5<UKTaxFigures!C3;0;A2)
in A3. If necessary you can pick the formulas even further apart to make them more readable. Then in the end you just copy the formulas from the cells, and replace the references with them.
Please note that I am not 100 % certain that I got everything correct, without proper data it is somewhat difficult to keep track of all the parantheses and results. But this should at least give you a good starting point.

Conditional formatting on Excel 2007, need to add formula

I have to show 3 conditions using Conditional formatting.
If the % change in the cost driver is more than .25% higher or lower than the % change in actual price.
More than .25% - Red
Less than .25% - Green
In between - Yellow
I'm able to get the first two, but not the third one.
For Green, I used this formula - =if(1.30-1.40/1.30)-(1,210-1,170/1,210)<.25, For Red =if(1.30-1.40/1.30)-(1,210-1,170/1,210)>.25
I tried using Between and Median for Yellow (-0.25% and 0.25%), but does not seem to be working.
Product Location Jul-13 Aug-13 Sep-13 Oct-13
1 A 1.40 1.30 1.34 1.47
2 B 1.43 1.43 1.46 1.47
3 C 1.40 1.41 1.45 1.46
Driver 1,170 1,210 1,260 1,225
Unless I've got the wrong end of the stick here, it looks to me as though you currently have:
for red: if < -0.25%
for green: if > 0.25%
for yellow: if (<= 0.25% OR >= -0.25%)
None of the data you provided match the condition for yellow, hence you aren't getting any results.
Using E17 and F17 as the demo cells, you could do:
=IF(AND((F12-E12)/E12*100<=0.25,(F12-E12)/E12*100>=-0.25),"Yellow",IF((F12-E12)/E12*100>0.25,"Green",IF((F12-E12)/E12*100<-0.25,"Red")))
If E17 is 1170 and F17 is 1171 you will have "Yellow" output. 0.25% higher or lower you will have "Green" or "Red" output respectively. You can use text conditional formatting from the word.

Want formula to return a number value or blank

I have two columns (A & B) of information. I'm trying to create a third (C) with the answer of B divided by A in the form of a percentage or if 100% a blank or dash (-). Below is an example.
I've tried several different formula combinations like =IF((B38/A38)<100,(B38/A38)," ") I can get the percentage answers okay but have not been able to get the wanted result of a blank or a dash.
**A** **B** **C**
1.99 0.99 49.7%
1.99 1.99
3.99 3.99 -
2.99 1.99 66.6%
Thank you for any help given.
100% displayed as an integer is 1, so you want =IF(B1/A1=1,"-",B1/A1)
You are not getting the desired result for the blank because the statement is always true. replace 100 by 100%-
=IF((B38/A38)<100%,(B38/A38),"")

Resources