Find particular increase between two cells in column of numbers [closed] - excel

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I'm hoping to find a solution for the following problem. Consider a column of numbers in the following sequence:
{2,2,2,2,4,4,4,4,7,7,7,7,8,8,13,13,13,13,13}
Now I want to check if in this sequence at some time, there is a particular increase in the sequence. So if I'm looking for an increase of 5, I notice that between 8 and 13 the sequence increases by 5.
I have two possible solutions in mind, but I can't seem to find a kind of elegant way of achieving this without VBA.
Solution 1: Get the unique values from the list, taking the difference between the numbers and see if 5 is in it.
Solution 2: Subtract the first value until the (N - 1)th value from the second to Nth value and see if 5 is in it.
I'm also hoping to fit the code in one cell!
Any help would be greatly appreciated.

Assuming you data is in Column A, then the formula
{=OR(($A$2:$A$20001-$A$1:$A$20000)=5)}
will get TRUE if there is a increase of 5 between two cells in $A$1:$A$20000.
This is an array formula. Input it into the cell without the curly brackets and press [Ctrl]+[Shift]+[Enter] to confirm. The curly brackets should then appear automatically.

Related

Find in Excel the smallest sum of 4 numbers from x datasets of 4 numbers each? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 days ago.
Improve this question
I want to use excel to find the best combination of swimmers for a 4x100m mixed medley. Each swimmer has 4 times recorder *one for each discipline fly, free, back, breast) and there are x swimmers.
The time notation is mm:ss,00 for each measurement.
The result should be the names of the swimmers who have combine e best time as a sum.
A swimmer can not swim in two disciplines at the same medley.
Any ideas on how this can work out in excel without VBA?
Thanks!
Miltos
I changed every time measurement to a decimal number and tried to add the possible combinations together, so that I can then compare the results and find the minimum which would give the best combination. I can not find an easy way to do the combination sums.

Getting subtraction wrong in excel [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 12 months ago.
Improve this question
This is absurdly simple but I am not getting what I am doing wrong, please help me out.
My formula is very simple:=V40 - SUM(O40:P40,R40:S40)
The values of V40 is 107, O40 is 80, P40 is 0, R40 is 1, S40 is 0
Ideally the result should be 107 - 81 = 26, but no matter what I do the result that comes is 0
Things that I have tried
Changed the format of all the cells to Number format
Tried to use Numbervalue on the formula to get correct value, but no result =NUMBERVALUE(V40)-NUMBERVALUE(SUM(O40:P40,R40:S40))
PFB the cells in question:
PFB result in Evaluate Formaula :
For anyone looking for an answer or facing the same problem. Do the following things to resolve the issue
If your values are a result of other functions check if the formulas for these functions still hold true, if not correct them
try recreating the same formula in different parts of the worksheet/workbook, if the formula works then error is isolated to the cell where you are getting the results
Try with static values in the formula instead of dynamic, if the problem still pertains then issue is with the cell
** Check the format of the cell** Change it to number format
** Check whether the calculations for the sheet/workbook are set to automatic instead of manual**
These steps should help you isolate the problem to a certain degree
Thanks to #Rory & #MayukhBhattacharya for helping me figure out how to sort this issue

Excel function that returns the closest number to zero without rounding [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need a function that returns the closest value to zero from from a range e.g A1 - A10.
I have found solutions for this on other websites however the value that is returned is rounded to no decimal places.
For my purposes I need the closest value to zero that retains up to ten decimal places.
I have tried the formula:
=INDEX(A1:A15,MATCH(SMALL(INDEX(ABS(A1:A15),0,1),COUNTIF(A1:A15,0)+1),INDEX(ABS(A1:A15),0,1),0))
however, If say the closest value is -1.0896 It will return -1 not -1.0896
I have a vba procedure changing the values in the range. so a vba solution that saves the closest value to zero to a variable would work.
When I use your solution from your question it seems to work, it does not round -1.002 to -1, it shows -1.002 if that is the closest to 0. However an alternative:
It isn't very pretty but if you need it to retain the negative value then this should work:
{=IF(MIN(ABS(A1:A25))=MIN(ABS(IF(A1:A25>0,A1:A25,MAX(A1:A25)))),1,-1)*MIN(ABS(A1:A25))}
I think the only time it wouldn't work is if all the numbers were negative, in which case it would return the number as a positive. The only way I can think of to negate this would be:
{=IF(MAX(A1:A25)<=0,-1,IF(MIN(ABS(A1:A25))=MIN(ABS(IF(A1:A25>0,A1:A25,MAX(A1:A25)))),1,-1))*MIN(ABS(A1:A25))}
As I said, not pretty but without VBA I can't think of a better solution; I'd love someone smarter than me to show me a better way...
Note The { curly brackets denote an array formula, you type it without the brackets and hold Shift + Ctrl while hitting Enter to tell Excel it is an array.

Starting binary input with 0s in a cell [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
First up, I'm not sure if this is the right place to ask this or not, so if it's not please let me know.
Ok so,I'm working on a project that deals with numbers in the binary format as inputs, however, when the input let's say begins with "00" or any number of 0s, it discards it in Excel so I was wondering how to force excel to accept 0s at the beginning of a binary input
I found the simplest solution after working with Excel this past week.
To include leading 0s, I should select the cell containing my decimal number and simply use the dec2bin function in Excel and define how many bits I want to output to be.
=DEC2BIN([number or cell reference],[#bits])
So if you enter "=DEC2BIN(A1,8)" in the formula bar, and the value of A1 is 15, the value output will be 00001111.
You need to provide it with a custom format!
Select the cell(s), and go to the Format Cells dialog (Ctrl-1). In the number format, choose Category "Custom" and here enter 0000 as the custom format. The number of 0 indicate the total number of digits display. If less are entered, it'll be filled with leading 0.
An old post, still:
I was having the same issue (with IP numbers) and found a different solution:
In one cell you do the conversion: =DE2BIN(10)
In the other cell you format it with TEXT formula: =TEXT($A$1,"00000000").

Finding the Smallest Non-Negative Integer Not in a Given List [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am attempting to write a program in Excel that finds the smallest non-negative integer not in a given list and places it into a cell. The list will contain only non-negative integers. I can do this if the values in the list have an upper bound quite easily using a series of if statements, but the list can (and will) contain arbitrarily large values. I am quite new to using Excel, so I would greatly appreciate it if you could provide a formula I could simply place into the cell (i.e. no macros, if possible). Thank you in advance for any assistance you can provide on this topic.
Examples:
List = {0,1,2,3,4}, Output = 5
List = {0,1,2,4,7}, Output = 3
List = {1,2,3,4,7}, Output = 0
Given your edited question then assuming you will have at least one integer missing in the range 0 to 99 try this formula where List is in A1:A5
=SMALL(IF(COUNTIF(A1:A5,ROW(INDIRECT("1:100"))-1)=0,ROW(INDIRECT("1:100"))-1),1)
confirmed with CTRL+SHIFT+ENTER
This version will also give you the same result without "array entry"
=LOOKUP(2,1/(COUNTIF(A1:A5,100-ROW(INDIRECT("1:100")))=0),100-ROW(INDIRECT("1:100")))
See example below showing the outcome for each of your example lists:
MIN(A:A) will get you the smallest number in column A - just subtract 1 (or any number really) to get a number smaller than any of those (or use MAX to get largest). Update the formula as necessary based on where your data is. If the result needs to be an integer, just ROUNDDOWN it.

Resources