Format numbers in thousands (K) in Excel - excel

In MS Excel, I would like to format a number in order to show only thousands and with 'K' in from of it,
so the number 123000 will be displayed in the cell as 123K
It is easy to format to show only thousands (123), but I'd like to add the K symbol in case the number is > 1000.
so one cell with number 123 will display 123
one cell with 123000 will show 123K
Any idea how the format Cell -> custom filters can be used?
Thanks!

Custom format
[>=1000]#,##0,"K";0
will give you:
Note the comma between the zero and the "K". To display millions or billions, use two or three commas instead.

Non-Americans take note! If you use Excel with "." as 1000 separator, you need to replace the "," with a "." in the formula, such as:
[>=1000]€ #.##0." K";[<=-1000]-€ #.##0." K";0
The code above will display € 62.123 as "€ 62 K".

[>=1000]#,##0,"K";[<=-1000]-#,##0,"K";0
teylyn's answer is great. This just adds negatives beyond -1000 following the same format.

Enter this in the custom number format field:
[>=1000]#,##0,"K€";0"€"
What that means is that if the number is greater than 1,000, display at least one digit (indicated by the zero), but no digits after the thousands place, indicated by nothing coming after the comma. Then you follow the whole thing with the string "K".
Edited to add comma and euro.

The examples above use a 'K' an uppercase k used to represent kilo or 1000. According to wiki, kilo or 1000's should be represented in lower case. So, rather than £300K, use £300k or in a code example :-
[>=1000]£#,##0,"k";[red][<=-1000]-£#,##0,"k";0

I've found the following combination that works fine for positive and negative numbers (43787200020 is transformed to 43.787.200,02 K)
[>=1000] #.##0,#0. "K";#.##0,#0. "K"

Related

How to select a few numbers from a given number

If I have entered a certain 4 digit number for example ,1234 how do I choose like the first 2 numbers or the last two numbers from the cell by that i mean suppose i want it to return 34 for the last two digits and I want it to return 12 for the first two digits. So anytime I change my 4 digit number it works the same way.
You may use the LEFT and RIGHT functions, e.g.
=LEFT("1234", 2)
=RIGHT("1234", 2)
If your 4-digit number is, in fact, a string you can parse the string as suggested by #Tim Biegeleisen. In my Excel 365, when I enter 1234 in a cell formatted as General I can use the same method.
=LEFT(A1, 2)
and
=Right(A1, 2)
However, this conversion of a number to text mustn't be presumed to work under all circumstances. Therefore you may prefer to convert the number to text explicitly in the formula.
=LEFT(TEXT(A1,"0000"), 2)
and
=Right(TEXT(A1,"0000"), 2)
This method has the added advantage of being able to handle numbers of less than 4 digits.
On the other hand, you can also extract first and last digits from a true number, without converting it to text.
=INT(A1/100)
and
=MOD(A1,100)
The main difference is that the results are also numbers (all partial strings are text). Therefore this would be the preferred method if you don't want to worry about strings, text, numbers, numerics and cell formats.

Extracting certain numbers from a cell containing numbers and special characters

I have cells that contain both numbers and special characters such as this:
[1:250:10]
The 'coordinates' shown above can be in the following format.
[(1-9):(1-499):(1-15)] in terms of what numbers can be within each part.
How do I extract these three numbers into three separate cells?
Assuming your data is in Cell A1 the to extract first number use following formula
=MID(A1,2,(FIND(":",A1,1)-2))
for second number use
=SUBSTITUTE(MID(SUBSTITUTE(":" & A1&REPT(" ",6),":",REPT(":",255)),2*255,255),":","")
finally for third number enter
=SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A1,":",REPT(" ",LEN(A1))),LEN(A1))),"]","")
Just tossing out some other options.
First number since it only has a length of 1 digit and is on the left side, use the following:
=RIGHT(LEFT(A1,2))
second number will be found by locating the : in the string
=MID(A1,FIND(":",A1)+1,FIND(":",A1,FIND(":",A1)+1)-(FIND(":",A1)+1))
third number will be dealt with in the same way as the second but we will use the second : and the ] as the identifiers as to where to grab from and how much to pull.
=MID(A1,FIND(":",A1,FIND(":",A1)+1)+1,FIND("]",A1)-(FIND(":",A1,FIND(":",A1)+1)+1))
now all those number will actually come through as text. If you want to have them as numbers in the cells, send them through a math operation that will not change their value. Do something like +0, -0, or *1 at the end. Alternatively you could add -- at the start of each formula (yes that is double - incase you were wondering if it was a typo)

Excel TEXT function - Number Positioning

I'm calculating the difference between 2 columns of data and calculating the numeric difference and % increase. I wanted to combine these two values in one cell using the text function.
The problem: I have successfully done this in excel but have a formatting problem. I have separated the numeric and percent difference by the delimiter "|". Sometimes the % difference value is two digits and some times its 1 digit. I'd like to have a placeholder for the tens digit so all of the delimiters align in the column. Is there any way to do this using the function?
For example, you could solve this problem by adding "000" in the format_text argument for the second text function, but I don't want any leading zeros in my display cell.
Thank you,
You can use ? to add leading or trailing space:
= H70-F70 & Text(H70/F70-1, " | ??%")
You can also use Monospaced font like Courier New for better alignment.

Determine the number of search results upon using different sets of separators (Excel)

I would like to ask for your help with the formulation of a formula in Excel in order to compare the total number of search results upon using different sets of separator characters.
As I have multiple columns with content, as in the example below, I thought it would be possible to Count the search results in some way and do this for each column separately ( I would actually prefer to treat each column separately).
A
1 L-516-S-221-S-223
2 H-140.STR3
3 ST0 XP 23-9
4 etc.......
Preferably, I would like to use a varying a set of separator characters in order to determine the impact on the number of search results based on this set of separator characters. Logically, with an increasing number of separators more results will be returned (depending on separators included in the cell values of course).
The set of characters that I would like to experiment with is: “-_ .,;: “
Hopefully this makes sense and someone is able to help me out. Thank you.
Kind regards,
P
In your example - on its own will detect all three instances but for an overview you might construct a grid (say B1:H1 of your separators, including a space rather than an empty cell) and ColumnA each column in turn (maybe via links) then a formula in B2 such as:
=--ISNUMBER(FIND(B$1,$A2))
copied across to ColumnH and down to suit.
Alternative formula (for different question):
=IF(LEN($A2)-LEN(SUBSTITUTE($A2,B$1,""))>0,LEN($A2)-LEN(SUBSTITUTE($A2,B$1,""))+1,0)
Assumes, for example, no trailing spaces and separators are always separated. Results are not necessarily cumulative.

Concatenate Custom Function

On a daily basis I need to load data to one of our systems. However Excel deletes the previous zeros in front of the contractor IDs. So i have to add THREE zeros manually. I normally use the CONCATENATE function however now the IDs are coming differently so some IDs now only need to have TWO zeros added.
example:
ID
911111
I use concatenate to make it look like:
000911111
I came up with the IF formula that detects if the ID starts with a number NINE, to concatenate TWO zeros and if not, then to add THREE zeros.
example:
=IF(LEFT(A32,1)="9",CONCATENATE("00",A32),CONCATENATE("000",A32))
Now I want to create this formula as a custom defined so I do not have to write down the formula ever time I work on the data every day.
Any suggestions I will really appreciate.
In addition to the formatting responses provided in the comments, you could use the RIGHT function to cut off the leading zeroes to the appropriate amount.
For example, assuming A1 holds a string of numbers, between 0 & 9 digits long. We can create text representing a 9 digit string, with as many leading zeroes as necessary, as follows:
=RIGHT(REPT("0",9) & A1,9)
REPT("0",9) tells Excel to repeat the character "0" 9 times. It then tacks on whatever text is in A1. Then it takes only the rightmost 9 characters of the concatenation.
I generally would recommend the Formatting options noted in those comments, unless you need the text to be 9 characters for other formula purposes.

Resources