3 data sets results help required - excel-formula

I need a formula that requires the following to happen:
if Cell A1 is between 0-150%, return a number 1;
if between 151-199%, return 2;
if >200%, return 3.
How can I do this in Excel?
I can get it to produce this =IF(OR(A1<=150),1,)*IF(OR(A1<151),2), but that only produces 2 outcomes.

The else part can be a separate IF, so:
=IF(A1<=150,1,IF(A1<200,2,3))

Related

Concatenate and sum hours depending on condition in Excel / Calc

I am having this example in Excel / Calc (download here):
I would like two things:
to sum automatically TIME of category = MANAGEMENT (the same for MEETING)
to concatenate (separated by ; ) description of category = MANAGEMENT (the same for MEETING). In case of MANAGEMENT it should be like this: Task 1; Task 3; Tastk 5; Task 7; Task 8.
How can I do these two options to have a matrix of two lines (Management and Meeting) and two columns (Times and Descriptions)?
To find the sum, you can use the SUMIF() or SUMPRODUCT() function
=SUMIF($A$2:$A$1000;O2;$E$2:$E$1000)
=SUMPRODUCT($A$2:$A$1000=O2;$E$2:$E$1000)
Just format the result as time and instead of 0.145833333333333 you get 03:30
The TEXTJOIN() function will help you to combine the required strings
{=TEXTJOIN(";";1;IF($A$2:$A$1000=O2;$B$2:$B$1000;""))}
Do not forget to enter it as an array formula, finished entering Ctrl+Shift+Enter

Sumproduct with OR and Right function

In column A are IDs like "1.23.1". The first and last numbers are the ones I use to identify the IDs I am looking for. The middle numbers range from 1 to 999, so IDs could be "1.1.1" OR "1.231.1. This information is only important to show that not all IDs have the same amount of characters.
I need to add the numbers from column B that match the IDs I am looking for.
A ----------- B
1.21.1 ------------5
1.314.2 ----------6
2.2.1 -------------3
I am getting a #VALUE! error with the following formula.
=SUMPRODUCT(OR((RIGHT(A4:A6,1)="1")+0,RIGHT(A4:A6,1)="2")+0,LEFT(A4:A6,1)="1",B4:B6
I would like to add the 5 and 6 because their IDs both end with 1 or 2 and start with 1.
Example
=SUMPRODUCT((LEFT(A4:A6)="1")*((RIGHT(A4:A6)="1")+(RIGHT(A4:A6)="2"))*B4:B6)
Using the OR function will only return a single value; hence your arrays will not be all the same length; hence the #VALUE! error.
Using addition will return an array of the OR test for each cell, instead of a single OR for the entire array.
If you want to use the function with separate arrays, where you convert each test array to it's numeric equivalent, (as in your example) you can use:
=SUMPRODUCT(N(LEFT(A4:A6)="1"),N((RIGHT(A4:A6)="1")+(RIGHT(A4:A6)="2")),B4:B6)

Use "if" function to identify specific hours

I have an excel table see attached picture. I want to find which cells (rows) contain specific hours. To do so I used the if function:
=IF(B2=HOUR("12:00:00");"xx";"yes")
The outcome was not correct. As you can see the outcome was "yes" corresponding to false.. What is the problem ?
In addition, I tried to embed the "and" function, in order to select multiple hours, but the excel prompt error message. The formula I tried in cell B2 is:
=IF(B2=HOUR(AND("12:00:00";"3:00:00");"xx";"yes"))
error message:
contain many conditions
I think you have swapped the arguments in your comparison.
According to the documentation
[HOUR] returns the hour of a time value
If we evaluate your formula step by step, we get:
HOUR("12:00:00") -> 12
B2 = 12 -> false
IF(false; "xx"; "yes") -> yes
To fix this, change your condition to HOUR(B2) = 12.
That should work for a single hour.
If you want to check for multiple hour values, you can use the OR function, as noted in a previous answer, but with modified conditions like this:
IF(OR(HOUR(B2) = 3; HOUR(B2) = 12); "xx"; "yes")
First you just have misplaced the return of the true and the return of the false. Try :
=IF(B2=HOUR("12:00:00");"yes";"xx")
Second, you do not want a logical and but a logical or. And your condition is "if B2 is an hour that is equals to '12:00 and 3:00'" this has no sense. What you want is "if B2 is an hour that is equals to '12:00' or B2 is an hour that is equals to '3:00'". This should look like :
=IF(OR(B2=HOUR("12:00:00"), B2=HOUR("3:00:00")) ; "yes"; "xx"))
Edit : Thanks to Korrat answer I can correct mine. The hour should not be compared like this. You should use the function HOUR on the cell and not on the value.
=IF(OR(HOUR(B2)=12, HOUR(B2)=3) ; "yes"; "xx"))

Converting a excel field from a % to a decimal in a new formula

I have 4 different values being generated on a spreadsheet in different cells:
A=88.45%
B=88.45%
C=1.69%
D=95.67%
I need to add these values up and divide it by 4 to get the difference from a possibility of 100%. So, the functions I've written are:
A= =SUM(1-(D6/C6))
B= =SUM(1-(F6/C6))
C= =SUM(I6/H6)
D= =SUM(1-(K6/C6))
However, if I just have a formula that adds those cells up while they are displaying as a % and then divide it by 4 it doesn't give me the intended number which I need. The only way I've figured out to give me the accurate result was to convert them into decimals, but I'm not sure how to exactly write that. If it's even possible. I still need them displaying as a % in the original cells is the issue.
A= 0.1155
B= 0.1155
C= 0.0169
D= 0.0433
Divide those by 4 and you get the correct 7.28%. Then I need to subtract that from 100% to generate the actual average of those 4 cells.
Any insight?
**EDIT* 2nd formula added
The proper formula to obtain your desired result of 7.28% from the four values in Row 34 (January) is:
=SUM(1-E34,1-G34,J34,1-L34)/4
OR
=1-AVERAGE(E34,G34,1-J34,L34)
where:
E34:= 88.45%
G34:= 88.45%
J34:= 1.69%
L34:= 95.67%
As an aside, the SUM function in each of those cells is entirely superfluous.
=1-D34/C34
will give the same result as
=SUM(1-(D34/C34))

How can I use four time equal (ex. ====) in excel formula

I'm unable to use below formula in excel
400+rate÷400×principal====
Ex.
Do this in calculator:
400+9.05÷400×10000
Now press four times the equal button. Answer is 10936.17. But I'm unable to do this in Excel. I hope someone may help me.
You don't need to write ====, just one = is enough. Also, use * and not x, use / and not ÷.
If you want the result to be 10226.25, you need some math predecessors using brackets ().
Enter this equation in a cell:
=(400+9.05)/400*10000
This gives the expected outcome:
10226.25
Whenever you press = in the calculator you are multiplying the result by the operation before it
400+9.05=409.05 you will get the result without =in the calculator if you only press ÷
409.05 ÷ 400 = 1.022625 this is the number that each time you press = will multiply the result in the calculator
you write X 10000 and first = 10266.25 first result
second = is 1.022625 X 10266.25 second result 10457.62
third = is 1.022625 X 10457.62 third result 10694.22
fourth = is 1.022625 X 10694.22 fourth result 10936.18 your outcome
In Excel you have to write:
=(((400+9.05)/400)^4)*10000 to have the same outcome
It's true that Excel can be used as a Calculator up to certain extent,, but it's not created to act like a Calc,, always remember ever calculation begins with = sign followed either by Function or data.
So finally you should write your Formula like this,
=(400+9.05) /(400×10000)
You might find a parameterised version useful:
The inputs are shown in blue, the output in F2 where the formula is:
=C2*((A2+B2)/A2)^D2
D2 is effectively the number of equals signs depressed on your calculator.

Resources