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").
Related
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 yesterday.
Improve this question
With Excel, I am trying to format my numbers to display as thousands.
1000 should be 1 k.
I usually use the format numbers from Excel. Depending on the language, I add a "space" or a "," after the last digit of my formatting in order to get a x1000 division.
I used to have:
Format numbers in thousand: 0, "K" (US) or 0 space "K" (French, for instance)
Format numbers in millions: 0,,"M" (US) or 0 double-space "M" (French, for instance)
However, it is not working anymore and now it just displays my numbers with a comma/two commas at the end instead of having thousands or millions.
Do you know what it could be related to and how to parameter the cells format?
In my Advanced settings, I am using the "," as Decimal separator, and the " " as Thousands separator
Note: I would like to avoid having a formula as I only want to act on the cells format. For now, my workaround (not satisfying) is creating a "mirror" page using =ROUND(Cell/1000000;0) to display Millions, for instance
Thank you for your help
to do so, follow these steps:
1- choose cells you want to change format.
2- Press Ctrl+1 to open formatting popup (Number tab)
3- select 'Custom'
4- Enter this pattern for converting into thousands with K:
#,##0.0, "K"
5- And this pattern for converting into millions with M:
#,##0.0,,"M"
Okay so I've spent some time digging through stack overflow other various websites, I'm not even sure this is possible but here's the example.
I have an excel sheet with quite a bit of information, in column A there are various types of information however I specifically only want the cells that have #####-###.
The issue is that the other users will sometimes replace the last 3 digits with question marks and similarly, when adding the dash it doesn't treat it as a number it's considered general format...
Like I said I maybe have the number 60613-555, then right below it part numbers/names etc, so I only want that cell with the project number to have the top line border...
Use this as the rule:
=ISNUMBER(SEARCH("????-???",$A1))
And apply it to the columns desired:
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.
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.
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.