Custom Number Format problem

I need a special number format, but I can't seem to get what I want:

IF a number is an integer, then there should be NO decimal point
displayed.
IF a number has a decimal part, then if should display only one digit
for it.

For instance:

3 -> 3
4.34 -> 4.3
2.88 -> 2.9
34 -> 34
5.01 -> 5.0

Is it possible to do this with a custom number format ?

THANKS !

R
P.S. I would prefer NOT to use any VBA to do this!

0
10/12/2006 3:34:24 PM
excel 39879 articles. 2 followers. Follow

2 Replies
489 Views

Similar Articles

[PageSpeed] 42

Maybe.

But easier would be:

=IF(MOD(A1,1)=0,INT(A1),ROUND(A1,1))

and format as General

Of course you can replace A1 with your original formula, but then it is calculated twice

-- 
Kind regards,

Niek Otten
Microsoft MVP - Excel


"RiTz21" <richard.taillon@gmail.com> wrote in message news:1160667264.231234.134450@c28g2000cwb.googlegroups.com...
|I need a special number format, but I can't seem to get what I want:
|
| IF a number is an integer, then there should be NO decimal point
| displayed.
| IF a number has a decimal part, then if should display only one digit
| for it.
|
| For instance:
|
| 3 -> 3
| 4.34 -> 4.3
| 2.88 -> 2.9
| 34 -> 34
| 5.01 -> 5.0
|
| Is it possible to do this with a custom number format ?
|
| THANKS !
|
| R
| P.S. I would prefer NOT to use any VBA to do this!
| 


0
nicolaus (2022)
10/12/2006 3:42:49 PM
Alas, this is for a cell where the user 'inputs' numbers... so I cannot
have a formula in that cell!!  I seek a way using the Custom Format, if
it is doable...

Thanks !
R



Niek Otten wrote:
> Maybe.
>
> But easier would be:
>
> =IF(MOD(A1,1)=0,INT(A1),ROUND(A1,1))
>
> and format as General
>
> Of course you can replace A1 with your original formula, but then it is calculated twice
>
> --
> Kind regards,
>
> Niek Otten
> Microsoft MVP - Excel
>
>
> "RiTz21" <richard.taillon@gmail.com> wrote in message news:1160667264.231234.134450@c28g2000cwb.googlegroups.com...
> |I need a special number format, but I can't seem to get what I want:
> |
> | IF a number is an integer, then there should be NO decimal point
> | displayed.
> | IF a number has a decimal part, then if should display only one digit
> | for it.
> |
> | For instance:
> |
> | 3 -> 3
> | 4.34 -> 4.3
> | 2.88 -> 2.9
> | 34 -> 34
> | 5.01 -> 5.0
> |
> | Is it possible to do this with a custom number format ?
> |
> | THANKS !
> |
> | R
> | P.S. I would prefer NOT to use any VBA to do this!
> |

0
10/12/2006 4:50:21 PM
Reply:

Similar Artilces:

Custom Entity Relationship CRM 3.0
I have created a new custom entity (A) for which I need to create two referential relationships to other custom entities (B) & (C). (A) is the primary entity in both cases. The relationship between (A) and (B) acts normally. The relationship between (A) and (C) doesn't. When I try to add a (C) record from (A), (A) displays two records in the (C) lookup. One "record" displays data from system fields (created on and status). The second "record" displys data from the primary field. I am not able to access (C) record from the associated view in (A), but I can a...

Statements: Numbering and then being able to apply based on state
Have a client who can have 20,000 invoices for a customer in a month. The customer only gets a statement. Would like to be able to number statements and then if the customer pays the full amount be able to pay based on the statement number. Thought about using lockbox processing to try and set up a format based on the electronic data that comes back with the check as well. But need to find if anyone has a solution for the statement numbering We created a customization for a customer about 5-6 years ago that does something like this...it was pretty involved. From what I recall, ther...

Custom toolbar and macros
I am moving a user from Windows 2000 to XP and he has a worksheet with many custom Macros as well as the custon toolbar with it. We can move the worksheet and the macros will move with it. The problem is moving the custom toolbar with it. How do I get the toolbar to move along with the worksheet. One way: With the custom workbook active, choose Tools/Customize/Toolbars. Click Attach. Attach your custom toolbar to the workbook. In article <F0FC2885-07CB-4706-BC67-DEB7B664BACF@microsoft.com>, "MD" <MD@discussions.microsoft.com> wrote: > I am moving a user fro...

Problem with controls overlapping a child window
Hi I have a CDialog window with some controls, I have another CDialog (with with WS_CHILD attribute). When I show the child window (embedded in the parent), the parents controls that should be hidden beneath the child window are still shown. I have tried setting "Clip Children" and "Clip Siblings" as well as "Control" attributes (in the resource editor for the dialog templates) but I can't seem to get it rigth. Calling SetWindowPos with CWnd::wndTopMost on the child window doesn't work either. I could ofcourse just hide all the controls in the parent wi...

Listbox problem
I have the following code setup. My form has 5 listboxes on them named LB1 thru LB5. All listboxes are single select. The code simply captures which listbox has been clicked (onClick event) then it does some stuff (not included in following code) and finally deselects the entry in the listbox. It's giving me fits. It will not deselect the entry. Can anyone tell me what I'm doing wrong? thanks Dim ctlCurrentControl As Control Dim strControlName As String Dim intCurrentRow As Integer Dim tmp_selected As Integer Set ctlCurrentControl = Screen.Ac...

Item number/location code does not exist in inventory error
I'm using eConnect to do an SOP transaction and it has been working for months but with a new customer and a new site I'm getting an error. The error is: "Item number/location code does not exist in inventory". The same transactions are still working with other customers on other sites so it seems like it must be a set up issue in GP. The customer and site look like they're configured the same as the ones that work so I'm stumped. Does anyone know what the issue might be? Thanks, Matt Have you confirmed that the item number has been assigned to the new sit...

toolbar customization
533 MHz Power PC G4 384 MB SDRAM MAC OS X 10.3.3=20 Office X: Excel 10.1.5 (Service Release 1) When I drag command buttons to Excel's Standard Toolbar I get grayed-out = icons as follows: Hide Detail Show Detail Insert Rows Ironically the following buttons, dragged in precisely the same = fashionto the=20 Standard Toolbar, work satisfactorily: Insert Columns Delete Column Delete Row Any suggestions? Has MS discoveed and repaired these bugs for the May=20 2004 updates? While they're not bugs, they are confusing. You probably dragged the Insert Rows button from the Edit categ...

CRM Customization: Display Contact Info on Service Activity Form
We'd like to be able to open a service activity, and display all of the associated contacts' information (name, phone, address) on the same form. We have attempted to use IFRAMEs to load this information, but have so far been unsuccessful in achieving the desired effect. What is the best approach to take here? I am trying to do the same... What I really want is: 1) Service activity calendar view to show the customer name, number and address in the mouseover 2) When a service calendar item is clicked on, I would like the contact name, address and telephone listed in the main fo...

weird CFileDialog / GetOpenFileName problem
I'm having two weird problems with CFileDialog and/or GetOpenFileName that QA is on my back to fix :). 1) Bring up a normal CFileDialog or GetOpenFileName dialog on Windows XP. Go to the filename field and leave it blank. Hold down the enter key and you will see the "Look in" label, the "Look in" combobox, the "File name" label, the "Files of type" label, the "File name" combo box, and the "Open" button all flash like crazy ** I found a fix for this bug, just reporting it ** 2) Bring up a normal CFileDialog or GetOpenFileName ...

RUS problem #2
Hi, I've got a problem with creating multiple distribution lists at once. I create the lists using "Users and Computers" and start mailenabling them using the exchange assistant. After mailenabling I start RUS to provide eMail addresses to them. Further on I start the OAL generator to publish them to the organization. Everything works without any failure. When I open the new created distr. lists using the address book of Outlook and open the properties of the lists I was wondering. Although all settings in AD are correct all distribution lists have got the same conent in ...

Tracking customer orders when receiving stock
With our current POS system we can place items on order for a particular customer (whether we are holding the stock or not) and when we generate purchase orders the system automatically pops up letting us know we have pending orders for customers. We can then generate a purchase order based on this information. When we receive the stock, we can print out a report for that order that lists what stock needs to be allocated to which customers. Is there a way with RMS that we can do this? Unfortunately it is a regular occurance that our stock levels can be incorrect, for instance we may have a 0 ...

MS Money 2002 sign-in problem
All of the sudden I seem to have trouble signing into my Microsoft Money 2002 account. When I fire up the program and enter my password I get this message: “Money is unable to verify your Online sign-in….” I have a Windows XP Pentium 4 computer with no recent changes. Here is what I have tried so far with no success: 1. Verified that I can get into my msn.com account; that my password works, etc. 2. Did a system restore on my PC back to when I last successfully got into Money 3. Registered the Msxml3.dll file 4. Did both a “level 1 and level 2 standard repair” of my Money file Any a...

Customize Does not WOrk
When I clip the customize outlook today button, it does not respond. Anyone have an idea of what the problem might be? Posted several times a day here: OL2000: You Cannot Customize Outlook Today After You Install Critical Update 813489 for Internet Explorer: http://support.microsoft.com/default.aspx?scid=kb;EN-US;820575 -- Russ Valentine [MVP-Outlook] "Glenn" <anonymous@discussions.microsoft.com> wrote in message news:05cb01c3cc7b$467a26c0$a101280a@phx.gbl... > When I clip the customize outlook today button, it does > not respond. Anyone have an idea of what the pr...

bin number on sop report
Hi all we are using gp 9.0 and would like to add bin numbers to the sop blank invoice form and are having some problems does anyone know how this can be done ? Hi Steve, Due to a report writer limitation of only being able to have one 1 to many relationship from the SOP_LINE_WORK table, it would take a fair amount of work to add the bin. Currently the Serial/Lot information links to the SOP_LINE_WORK table and that is a 1 to many relationship. If it so happened you do not use serial/lots it would be easy because you could remove the serial/lot information and table that is used in ...

extracting numbers from data
Hi, Is there a way to extract the numbers, remove them and place them in an adjacent column from the cells in the example below? The LEFT function does not do the entire trick, since the amount of numbers differs per cell and I still need to delete the number in the original cell. 1bla 1.1blabla 1.1.1blablabla 1.1.1.1blablablabla Thanks ...

matching a column of numbers to another in another spreadsheet
I have a spreadsheet of shortpayment amounts and their invoice numbers on one spreadsheet with a column of credit amounts with their invoice numbers on another spreadsheet. I need to match the credits written with the shortpayments. kinda like this spreadsheet 1 spreadsheet 2 inv # amount date Credit # Amount Date 122334 15.00 11-25-09 675555 15.00 12-10-09 223345 22.00 10-20-09 754444 22.00 111-25-09 naturally...

HLookup and Row Index Number
Hello. I am currently using the following formula, but want to improve it: =HLOOKUP(C3,'Drivers'!$C$4:$CT$34,5) Currently it is retrieving the number in the fifth row, but I am concerned that the number will change if the reference worksheet is ever altered. Is there a way to have Excel look up a value that is in a row with a certain label (eg, "Average Size") instead of the fifth row? Thanks! You can, using the MATCH() function on the row with the labels. Look in HELP for details. But of course it would have been better if Excel could do it the way you describe, at lea...

How to display HTML in Custom Task Pane
Does anyone know if it is possible to program a custom task pane in Office 2007 (using VSTO) to display hosted web content (i.e. HTML). How about locally stored HTML? My team is looking at ways of providing modest on-screen assistance to support our custom Add-in that docks nicely within the application and can be coupled with a few controls. If it's not possible, we're stuck using CHM. Thanks in advance. ...

Adding + in front of a number
I have a column of numbers which represent a change in value over the previous year. I want to have a + in front of the number if it's a positive change. Let's say my first number is 500. My problem is that I can write something like, if(a1>0,"+"&a1), but when then I can't format the number. If the number is in the millions I can't provide a comma as a thousand separator and I cannot tell it how many decimal places I want to show. Is there a really easy way to do that, or do I have to write a huge formula to precisely spell out the formatting within...

Exchange 5.5 MTA e-mail stuck problem
Dear All, please help our exchange MTA always stuck e-mail in server. We have 4 exchange servers in 3 sites. The problem always in 2 servers. please see below setting server1 ( Window 4.0sp6a & Exchange 5.5sp4) server2 (Window 2000sp4 & exchange 5.5 sp4_ server3 ( window NT 4.0sp6a & exchange 5.5 sp4 ) server4 (window 2000 sp4 & exchange 5.5 sp4) Sever1 & server2 is same network server3 & server4 in oversea Our problem always keep server2 with server3 & server4. We can ping to server3 and server4, we also use "net user //server3 ipc$" command. Pl...

Word text copied into email loses formatting alignment
When copying a Word document (containing indented and numbered paragraphs and bullet points into an email, the left alignment of the document loses its justification. How can this be fixed? -- HK If the formatting is important, send the document as an attachment. You have no control over how the recipient sees the email. If you are concerned that the recipient might not have Word, use one of the free pdf converters to convert the document into a .pdf file. -- Hope this helps, Doug Robbins - Word MVP Please reply only to the newsgroups unless you wish to obtain my s...

memory limit on the number of sheets created
is there a limit on the number of sheets a macro can create? I notice I have a macro that creates sheets and it works up to sheet 26, after sheet 26 it crashes. I read on line that it is limited due to memory? Is that the ram on each computer ? tia, Hi There is no limit imposed by the macro itself. As you have found, the only limit to the number of sheets, is the available memory (RAM) on the system. In most cases you can go way beyond 26 before hitting memory limits. I would think it is something to do with your code. Post the code, and maybe we can help. -- Regards Roger Govier ...

XY Scatter with Custom Labels
I have a list of products, each with an X (a dollar amount) and a value (a percentage). Is it possible to have each point labeled with custom value i.e.: Printer, or Digital Camera, rather than it bein labeled with just the values being plotted ($1,000, 2% or $500, 7%)? Any ideas are appreciated. Thanks, Keit -- hatzipe ----------------------------------------------------------------------- hatzipet's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2789 View this thread: http://www.excelforum.com/showthread.php?threadid=47392 You can edit the text of a labe...

Outlook 2002 Problem #5
When I paste text to the body of a email message using Outlook 2002, Windows XP laptop, I get: Microsoft Outlook has encountered a problem and needs to close. Error Signature: AppName:outlook.exe AppVer: 10.0.4024.0 ModName: mshtml.dll ModVer: 6.0.2800.1141 ...

Conditional Format: Dates
Date is displayed in cell like this: Thursday, January 01, 2004 Currently, cells have no cell color format. How can I set formatting so cells containing 'Sunday' are a different color? Is there a formula I can use or some function that will do this for me? If the dates are text use =ISNUMBER(SEARCH("Sunday",A1)) in the formula is box, if they are real dates use =WEEKDAY(A1,2)=7 format>conditional formatting and formula is -- Regards, Peo Sjoblom "JEM" <abc@def.com> wrote in message news:emRrHL1IEHA.2688@tk2msftngp13.phx.gbl... &g...