excel formula to convert a number between 0-5 as 5 and 5-10 as 10 etc - excel

I want to write a logic in excel that if value in a call is between 0 and 5 then the cell takes value as 5, if it is between 5 and 10 then the value taken is 10 and so on. How can I do this?

Try the int formula
=(INT(C5/5)+1)*5

Related

Arranging a list of values randomly

I would like to arrange a list of values randomly with a formula automatically.
My data has repetitive values.
Sample data in columns A:E
Data
4 6 8 0 0
1 5 5 7 9
So when randomized, in columns I:M, it would look something like this:
Randomized Data
6 0 8 4 0
5 1 7 5 9
I tried something with rand and randbetween, and found a formula but it doesn't work repetitive numbers. Can I get any suggestion please? thanks.
You can use a combination of RAND, RANK and INDEX:
The strategy is to create a vector of random numbers, calculate their rank, and then use this rank to read off the columns on the data set.
In the above screenshot I used:
=RANK(A4,$A$4:$E$4)
in A5,
=INDEX($A$1:$E$2,1,A6)
in A8, and
=INDEX($A$1:$E$2,2,A6)
in A9.
It might be possible to get this down to a single array formula, though the result then wouldn't be very readable.

How to add 2 hours to a current time of excel

I have
29/06/2019 13:25:00
I want it to be
29/06/2019 15:25:00
I have 1000 rows, to do this action, I am using Excel
Or you can simply do:
= A1+(2/24)
If you want to use this formula for all the 1000 rows directly (assuming again the input column is A) you can simply adjust it like that:
= A1:A1000 + (2/24)
You can apply this function to your cells. It will add 2 hours, 0 minutes and 0 seconds.
=A2+TIME(2,0,0)

How to check if a time noted is within designated window or range in Excel

I need to check if a time of collection is within allowed time window or not.
For e.g.
A B C
1 10.36 10.30 1 min out of +/- 5 minutes window
2 10.24 10.30 1 min out of +/- 5 minutes window
A1 here time of collection of data, and B1 is the scheduled time. The acceptable window or range for this is +/- 5 minutes out of window. In this case the time of collection is 1 min out of +/- 5 minutes window. Similar example is shown in row 2. How can i get C1 to show the message as above which can account for + 5 minutes and - 5 minutes scenarios?.
Thanks in advance.
=IF(ABS(A1-B1)>(5/1440),"Problem!","OK")
5/1440 is 5 minutes (1440 minutes in a full day)
Use this formula¹ in C1 and fill down as necessary,
=ROUND(MAX((ABS(A1-B1)-0.05)*100, 0), 0)
Use the following custom number format on column C,
0 \mi\n out of ± 5 \mi\nut\e wi\n\dow
The advantages of a custom number format is that the numbers remain numbers and are available for future calculations (e.g. SUM, AVERAGE, etc) while displaying the text you wish to show. Note the right-alignment in the cells indicating true numbers.
¹ This formula depends on the time values being mixed numbers and not true time. If the time values are true time with a non-EN-US number format then additional maths may have to be applied to the formula.

Excel - Count of entries below cumulative threshold without helper column

I have the following little table. I'd like a formula that finds the number of values where the cumulative total (of column B) is less than some threshold (tx).
I tried
{=MIN((SUM(OFFSET(B1,0,0,A1:A17))>tx)*A1:A17)-1}
but OFFSET doesn't seem to be arrayable like that. Obviously, this would be trivial with a helper column, but for certain reasons that is not possible.
So the correct answer here should be 10.
tx = .8
A B
1 0.112106465
2 0.110981698
3 0.091959216
4 0.082163441
5 0.073292066
6 0.072407529
7 0.071646289
8 0.061646797
9 0.06011448
10 0.057566381
11 0.050341978
12 0.048227061
13 0.043207335
14 0.03940462
15 0.012914194
16 0.007603446
17 0.004417003
You're not really looking for a MIN; rather it should be MAX that follows your condition.
In E7 as a standard (non-array) formula,
=AGGREGATE(14, 6, ROW(1:17)/(SUBTOTAL(9, OFFSET(B1, 0, 0, ROW(1:17), 1))<D7), 1)
      
I prefer the following array formula** due to its non-volatility:
=MATCH(TRUE,MMULT(0+(ROW(B1:B17)>=TRANSPOSE(ROW(B1:B17))),B1:B17)>=0.8,0)-1
Regards
The most succinct way to do it I've found is
=SUM(--(SUBTOTAL(9,OFFSET(B1,,,A1:A17))<0.8))
entered as an array formula, or, equivalently,
=SUMPRODUCT(--(SUBTOTAL(9,OFFSET(B1,,,A1:A17))<0.8))

Excel: Find the minimal value in a column

An Excel table consists of two columns (e.g., A1:B5):
0 10
1 20
3 30
2 20
1 59
I need to get the minimal value in column B for which the corresponding value in column A is greater than zero. In the above example it should be 20.
I tried using various combinations of INDEX(), MIN(), IF(), ROW(), array formulas, etc. - but I just can't figure out how to do it. :-( Any help would be appreciated.
Grsm almost had it
if you enter the following formula in C1 as an array (Ctrl+Shift+End)
=MIN(IF(A1:A5>0,B1:B5))
That should do the trick.
I think you have to make an extra column..
A B C D
0 10 false 20
1 20 20
3 30 30
2 40 40
1 50 50
column C : =IF(A1>0;B1)
cell D1: =MIN(C1:C5)
You need to do it in 2 stages
First use the MIN function to find the minimum
Then take that answer and use the LOOKUP function to select the row and column that you need.
Check the "Minimum And Maximum Values In A Range" example in http://www.cpearson.com/Excel/excelF.htm (you can download the same as well from the same section)
HTH
This is not identical, but very similar: Excel VBA - Find minimum of list of values?

Resources