VBA Number Formatting - Thousands Separator / No Decimals
Apr 11, 2014How do I use a number formatting function that gives me the thousands seperator and no decimals?
View 1 RepliesHow do I use a number formatting function that gives me the thousands seperator and no decimals?
View 1 RepliesOn my indows XP box, when I type a number into an Excel spreadsheet and it is in "General" format, the numbers appears like this (examples):
1234567
or this:
7.125
or this:
8.1
I want them to look just like that except for the first one, which I want to have the thousands separator:
1,234,567
I don't want to use a number format because
Excel makes you set a specific number of decimal places...I want the decimal places to float depending on how many decimal places there are in the entered number (just like the "General" format does). So basically, I want a "General" format, but with thousands separators (commas).
I tried using something like ###,###.### but that leaves a decimal place at the end of each integer (i.e. "123,456.") which is also not acceptable.
To display 1,100,000 as $1.1M & 110,000 as $110.0K I've used the below Custom Number Formatting.
[>=1000000] $#,##0.0,,"M";[
I have following data in one coloumn & in each cell it contains both txt & number. i want to separate these text & number in separate cell.
01533FHGB06533FFHHHGJJ15445W153GJGJ0656HJHJ01533DFDFGB06554FFHHHGJJ15445W153GJGJ0656HJHJFLKFSH54646FGG56464DSHJDJD54346
I want to show numbers on my excel spreadhseet in thousands. However, the challenge is I want to show negtive numbers in red within brackets. For instance, I have a number -104,784,089. I want to display it as (104,784) in red color. Similarly, I want to show 577,090 as 577. Is there a customer formatting I can set up in excel that do that?
View 2 Replies View RelatedHOw do we hard code excel to show when number typed as with the 1000 separator.
For Eg: 1,000
I have a giant sheet that culminates in a graph. It is for various regions. When used in a country with in-control currency, you end up with a nice healthy number that looks good on the graph. When our Zimbabwe office uses it with their crazy inflation and high prices, we get a crazy number that goes into scientific notation...
Anyway, my question:
Given a number like 4,200,000 or 6,500 or 345,123, I want to be able to show as few trailing numbers as possible, and give a nice K or B or D or however you abbreviate Quadrillion (kM? for Zimbabwe) after it.
And, if possible, I'd like to do it with number formats, but I am flexible so long as it doesn't use VBA.
The lookup table would be:
Sheet1 AB1<1,000As is21,000K31,000,000Mil.41,000,000,000Bil.5>1,000,000,000,000Tril. Excel tables to the web >> Excel Jeanie HTML 4
All numbers have 2 significant digits, and I want to keep 2, so if it ends up as 4,200,000, I want the answer to read 4.2 Mil, etc.
I tried doing this with a lookup, and couldn't handle it.
Is it possible through a macro that the cells where numbers is in percentage format should not show any decimal points (is should not roundoff) just decimal points should not visible. I am aware that this can be done by "decrease decimal" but data will be across thousand of rows manually it will be very time consuming.
I have attached a sample worksheet : Percent.xlsx
I want to automate the Display labels in my Charts using VBA Coding…
I would need to use this small code in Charts with different Scales as some of the Scales in my Data are in a very large Range close to Trillions so its not possible to have these as the Primary-Y-Axis Scale and therefore I would need to use the in-built Display label option which Excel provides..
However, I always prefer to have the scale in the Range of Thousands so the Max I can have in the Scale can be 10,000 so if there is any Number more than that or the Scale is going above than I would prefer that this gets auto-calculated to Multiply with the remainder and show appropriate Scaling.
For Ex:In this example My largest Number is 4500000000 which is 100 M..So I would want the scale to show 4500 and the Display label as X Millions..
So The Display Label would be different for different Ranges but the Max Scale preffered would be 10,000.
I want round off number to be with the decimals (usually decimals r discarded for round off feature). I ll be able to explain better with an example.
10.36+10.36= 20.72. If i round it up, it vl be 21.
what i am tryin is to get 21.00 after round off.
I prepare my bills in excel and after total of all products, if i get a decimal number, I would like it be rounded off to whole number with decimal and 00 at the end (eg. 21.00 instead of 21.27 or 22.00 instead of 21.77). I tried to change decimals but when I select 2 decimal places, it gives me the actual fig(eg. 21.27 instead of 21.00)
I am already using =sum for the total so cannot use another formula (as far as i know, 1 cell can have only 1 formula. Dunno if multiple can be used in a single cell).
I am having an issue with number format in my VBA code. The entire column of column D is format as ###.0000 (4 decimals places). There are certains cells which require zero decimal places. I am using the following bit of code, but it is not working correctly. It is still formatting the cell as 4 decimal places.
View 3 Replies View RelatedI’m using this code to change the value of an active cell with a spinner named: 1.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim lNum As Long
If IsNumeric(Target) Then
lNum = Target
If lNum = Target And Target >= 0 Then
With Me.Shapes("1").ControlFormat
.LinkedCell = vbNullString
.Value = Target
.LinkedCell = Target.Address
End With
Else
Me.Shapes("1").ControlFormat.LinkedCell = vbNullString
End If
End If
End Sub
The problem is, that whenever I click or activate a cell its value automatically changes to 0. The spinner works just fine modifying the value of the activated cell. The problem is that this code somehow causes all the decimals such as 0,3 0,1 or 0,8, entered manually, to change to 0. This way only integral numbers, such as 1, 45 or 100 are accepted. I must truly say I have no [no need to swear - mod] idea how to fix these problems meaning the automatically inserted 0 and the fact that the sheet doesn’t accept decimals changing them to an integral number.
I'm trying to create a formula which will allow me to do the following
1. Enter the number of jobs received
2. Divide it by the staff available without ending up with decimals.
As an example. Say I have 60 jobs to be allocated and there are 13 peeps to distribute them to I'm currently getting 4.62. What I need to do is make sure that the jobs are only issued as whole numbers. E.g 5 peeps gets 4 and 8 get 5. I also need to factor in jobs on hand etc but I have already cracked this.
is there any way by which you can alter the number of decimals in a custom format using just custom format process (ie no VBA).
For ex:
12 should appear as 12
12.1 should appear as 12.1
12.26 should appear as 12.3
Note 12 should NOT appear as 12.0
So point being adding the "m" is an irrelevance at this time - the key is to vary the decimal points essentially based on MOD(value,1) = 0
If you can (I'm really thinking you can't) let's extend it such that 12.1 should appear as 12.1 but 12.26 as 12.26
I know you can use [value>x] type rules but I'm guessing you can't use formulae in those rules ?
Is there any keyboard shortcut to increase or decrease the number of decimals shown directly (I mean without having to use ctrl + 1... etc )
View 7 Replies View RelatedI am trying to convert Degrees Minutes & Decimals of a minute (12° 34.567') to Degrees and decimals of a degree (12.57611°). I have the formula to convert latitude, that is two digits, but it doesn't want to work with longitudes, three digits. (see attachment). This is the formula that I am using:
=IF(A2="","",(INT((LEFT(A2,3)+MID(A2,4,6)/60)*100000)/100000)&"d")
I have a column with a number of strings looking like below examples
View 3 Replies View Relatedwe in india to any number put comma as stated below
ie 15,13,10,565.00
fifteen crores thirteen lacs ten thousand five hundred sixty five only.
00,00,00,000.00
but excel we have only thousand separator.it separates the number after every thousand.
can it possible in excel to formate number as per our style.
00,00,00,000.00
I have made some macros for importing data from a txt fileand to sort the data into a sheet ready to be exported into another txt file. I have made VBA to work with "." as decimal separtor within the spreadsheet.
But, when I run the macro to export the data into a txt file (I have used the macros from this site [URL] .....) it automatically changes all "." into ","
But why?!?
I need the txt file to load data into another program, and this program need the use of "." as decimal separator - and not ",".
I'm using an European windows system.
I have data which needs to be formatted with a thousand separator as below.
400.00
1,000.00
250,000.00
How can I do this without it displaying as below
,400.00
I do not want it reflected in the case of hundreds.
I am looking to semi automate and mass emailing routine. I done code to validate the email now I just want to do some code to append the validated emails. Was hoping someone could offer a quick and easy way to accomplish this task. Below are a list of emails as they would be in excel below that is a variable “strRecipients” that is used to append all emails.
jey.boks@some.state.tx.us
Breay@iglobal.net
rccep@chiter.net
edd.champ@moeaent.com
strRecipients = strRecipients & ";" & ""jey.boks@some.state.tx.us""
strRecipients = strRecipients & ";" & "Breay@iglobal.net"
strRecipients = strRecipients & ";" & "rccep@chiter.net"
strRecipients = strRecipients & ";" & "edd.champ@moeaent.com"
I have a workbook that is being used by users with both "," and "." as decimal separator. This is working all fine, except for one cell, where I need the number output to be displayed with two decimals. See formula below:
="Open at " & TEXT(+OHL!J$13+OHL!H$15,"0.00") & " and Go"
This example does not work with "," decimal settings.
Is there any different way to force two decimals in a text string, except for TEXT (where the format given in itself limits the cross decimal separator functionality)?
One of my colleagues wants Excel only to show whole thousands, but I am not sure how to do this
For example, if the number is 78654.98, he only wants it to show 78.
Is this possible?
I am trying to find a code that will allow me to Save Rows to a txt file with cell separator ?
I have put together this from other peoples work online and now all i need to work out is how to add a cell separator like a comer?
I have numbers in cell A1 (say 3545852) as a sum of a data range. I want to display it like this "Rs. 35,45,852.00 Cr."
How can i do this. I used text function like this
="Rs. " & text(A1,"0,00.00") & " Cr."
But it displays "Rs. 3545852.00 Cr."
I want thousand separator also.
I have a SAP application that outputs a field of data from a specific query. One column, the date, is produced in the format 18.02.2009. Is there any excel 'trickery' that can convert this into a standard british date format i.e. 18/02/2009 & then allow me to sort the entire data field by ascending date order?
View 6 Replies View Relatedto format cells with "lakh" separator.
Excel allows only thousand's separator.
The other option is to make the changes in the regional settings... which will
affect all other application.
I am writing some code for a fast vlookup. I have the following template. The formulas in column AU and AX need to be automated. actual file has 170000 rows, so the vba code needs to be fast.
AU formula is: =VLOOKUP(A2,$BA$2:$BC$180000,3,FALSE)
AX formula is: = IF(AN2 = "Test1","To be adjusted",
IF(OR(AN2="Test2",AN2="Test3"),VLOOKUP(A2,$BE$2:$BF$180000,2,FALSE),
VLOOKUP(A2,$BA$2:$BC$180000,2,FALSE)))
I wrote an excel program in Excel'03 for a dental office to manage state assistance patients and one of the table columns is the state assistance number. The problem is that the program defaults to a number format when it is entered instead of a text format, which is what I want. The issue is that state assistance numbers are always 8 digits and when it defaults to a number field the program drops the required preceeding zeros.
For example the number 00123456 will sometimes show up as 123456, which is wrong. It's like sometimes it will show up right and other times it gets a butterfly in its brain and deletes those zeros irritating the receptionist here. So, how do I get the table to either stay in text format or set up a number format that keeps the preceeding zeros?
I have a petty cash sheet set up:
A1 - Date
B1 - Receipt No.
C1 - DEPT CODE
D1 - NOMINAL CODE
E1 - Reason
F1 - Amount
G1 - Running total (I've put a little formula in there to keep the balance - clever eh!)
So - this is fine - except I have to add the total amount for each department/nominal code each month.
What I'm doing at the moment is copying and pasting, sorting the sheet by:
Department
Nominal Code
Date
Then doing a manual add up of each and adding it to my month end report.
I'm really not an expert at all - but I thought there must be an easier way for me to do it. After inputting the petty cash there MUST be a way that it can automatically calculate it?
Or is this going to be a difficult thing to do requiring expertise in pivot tables etc?