Format a cell containing a number

How can I accomplish so that the cell shows 001 instead of 1?

It's best to pre-format the such cells as Text. If you have just the occasional need, you can change the format to text on the fly by typing a leading single quote. '008 will show as 008 with the format changed from Automatic to Text.
Jerry

Similar Messages

  • Conditional formating if the cell contains any date

    Hi,
    In my excel sheet i have one column containing only date (US format) or else they are blank. I want to format the cells containing date to Red color. How do i do it
    Please help

    If you mean the font colour, just format the cells to have red font.
    So I guess you mean interior colour.
    You haven't said which version of Excel - it always helps.
    For Excel 2003, for example, select the cells then
    Format > Conditional Formatting > Cell Value Is > Greater Than: 0 > Format > Patterns > Red
    For Excel 2007 or 2010, Home > Conditional Formatting > Highlight Cells Rules  > Greater Than > 0 with Light red fill
    Bill Manville. Excel MVP, Oxford, England. www.manville.org.uk

  • The operator " " expects a number, but cell contains a string

    Error message: The operator "+ " expects a number, but cell contains a string. I imported data from a csv file. One column which I would like to sum has data in the following format 17:00
    How can I convert this into numerical data that can be summed?

    Hi Robert,
    What does 17:00 represent? Is it a Time of Day or a Duration, or something else entirely? Would 5:00 be represented as I wrote it, or would it be 05:00?
    Jerry

  • ERROR - "The formula contains a number outside of the valid range"

    Hello,
    I am using an equation that is returning the error "the formula contains a number outside of the valid range" when the constituent cells of the equation contain a negative number. I have tried using the inspector to format the problem cell(s) differently, but to no avail. The equation works fine in other respects. How is numbers deciding what the valid range for variables in my foruma is?
    I've done the math out separately to make sure the equation isn't dividing by 0 or something wacky, but there's nothing wrong with the formula or the result... It should be doing math and it's not!
    I haven't found any posts by other users with the same problem.
    Thanks.

    jd,
    It would help us if you paste the formula in your post here, exactly as it appears in the cell. Also tell us the values of the inputs to that formula.
    Changing a cell's format seldom has any effect on the calculation. Formatting changes how a result is displayed, but not what the result of the formula is behind the screen.
    Jerry

  • SUM function resulting WRONG values when some cell contains a string

    A very strange problem that can result in wrong financial calculations and big mistakes...
    If we have SUM function for some range of cells and one of them is treated as text string (I mean it's number in fact but Number is sure it's text string). than SUM function calulates ALL cells except this sell silently without errors and results in wrong result.
    For example we have cells and values
    A B
    =====
    1| 15 USD
    2| 0 USD
    3| 37 USD
    4| 1 USD
    5| 3 USD
    here the function SUM(B1:B5) should provide the result "56 USD"
    But if cell B5 is treated as text string (it can be still displayed as "3 USD" so we don't know it's treated as text string for some reason) than SUM(B1:B5) swill answer "53 USD".
    The problem is we DON'T know cell B5 is treated as text and we are fully sure that we have the correct sum of all 5 cells, in reality we see sum of 4 cells only....
    I think anybody working with financial or other important data can imagine how dangerous this SUM behaviour is.... I encountered several times that when importing data from Excel or by other ways numbers are imported as text strings. So if I have a lot of cells I'm not sure if all those cells are correctly styled or some of them for some unknown reason is treated as text string.
    In Microsoft Excel there is a very right solution. In MS Excel if any cell in the SUM is wrong format the SUM function simply provides error as a result. But in Numbers SUM doesn't tell us about error, it simply provides us with a wrong result!
    With formal logic the way SUM works in Numbers is total idiotism. If I ask to SUM B1:B5 than I definitely ask to sum ALL 5 cells, not 4, not 3, not 6 but 5 definite cells. If Numbers can't sum those exactly those 5 cells the only answer of the function should be ERROR.
    But Apple Numbers answers me some result of summing those cells that it's able to sum. Apple Numbers SUM function is not confused that I asked for SUM of 5 (not 4 or 3) cells and I expect to have this sum as a result.
    In fact Apple uses the right logic when we use another formula. If we use =B1B2+B3+B4B5 and any cell contains text string that we'll have error result the sam as in Microsoft Excel. So in this example Numbers behaves correctly.
    So why SUM (B1:B5) can provide totally different result as =B1B2+B3+B4B5?

    alexb2 wrote:
    So when I set format for my number as my local currency it's displayed as 123 XXX (XXX is my currency but it's not in latin). I see it's not only displayed but also stored as 123 XXX. That's different from Excel that stores only numbers in cells and shows number with prefix or suffix - Numbers storex number with prefix or suffix.
    No, you get this behavior because the original sheet is displaying values as currencies. I assumes that the import process pass it as a string because he doesn't recognize it as a currency value. As far as I know, Numbers stores the currency entries as a pure number and an indicator of the used currency.
    Here is an example.
    (a) the description of the numerical value (I underlined it: 456)
    <sf:number-cell sf:flags="4" sf:value="456" sf:col="1" sf:row="2">
    <sf:cell-style-ref sfa:IDREF="SFTCellStyle-46"/>
    <sf:content-size sfa:w="58.659881591796875" sfa:h="14"/>
    </sf:number-cell>
    (b) the description of the format (I underlined the used currency: XAM)
    <sf:cell-style sfa:ID="SFTCellStyle-46" sf:cell-style-default-line-height="12" sf:parent-ident="tabular-Basic-body-cell-style-id">
    <sf:property-map>
    <sf:SFTCellStylePropertyNumberFormat>
    <sf:number-format sfa:ID="SFTNumberFormat-23" sf:format-type="1" sf:format-string="#,##0.00 &#xA4;;-#,##0.00 &#xA4;" sf:format-decimal-places="2" sf:format-currency-code="XAM" sf:format-negative-style="0" sf:format-show-thousands-separator="true" sf:format-fraction-accuracy="-3" sf:format-use-accounting-style="false"/>
    </sf:SFTCellStylePropertyNumberFormat>
    <sf:SFTCellStylePropertyImplicitFormatType>
    <sf:number sfa:number="256" sfa:type="i"/>
    </sf:SFTCellStylePropertyImplicitFormatType>
    <sf:SFTCellStylePropertyFormatType>
    <sf:number sfa:number="257" sfa:type="i"/>
    </sf:SFTCellStylePropertyFormatType>
    </sf:property-map>
    </sf:cell-style>
    Of course, if the original currency string is not recognized, it can't be described as such a feature and the value is treated as a simple string.
    So may be at some moment my 123 XXX is treated like string value.
    Yes, find and replace is a nice tool when importing data - thanks for the tip. the last problem is with already Numbers files that were imported not today (or even createde as Numbers file) where some cell becomes string value after some editing.
    Here again, if you edit a currency string and replace it to a not recognized one, the result will be logically a string.
    There is an other way to give this result:
    copy a value from a cell formatted as XAM currency (just an example)
    paste it in a cell whose format is currency Euro (once again it's just an example).
    The result will be a string.
    The culprit is not the program, it's the user.
    I had several times this situation and last time I found error only because I have my budget in 2 programs - in Numbers and in another special budgeting program. As each program has advantages I have in fact 2 instances of the same budget.
    And when I changed some string in Numbers and another program I noticed the sum is different. I was sure it's another program somewhere buggy but noticed than Numbers simply ignores one of the budget strings and sums without it... In fact it was even not the string I changed, I remember I changed the buggy string about a week ago but I haven't compared budgets that time so my budget had a mistake for some time till I noticed it. If I used only Numbers without copy of budget in another program may be even today I won't notice the mistake.
    The same situation happened not once.
    I think that the choice made by Apple for SUM() is correct. You feel that it is wrong. It's useless to debate more, we will not change the behavior of the function.
    I try to give a workaround.
    The neater one is to add columns as I described in my first response.
    The given formula will clearly flag cells which aren't containing numerical values. If you move the SUM from the original range to the new one, the oddities will be flagged automatically.
    Here is an alternate workaround:
    The currency is XAM.
    In B4 I introduced a typo so the value is no longer a numerical one.
    Given that, the sum in the footer doesn't count the 34 (which is the normal behavior).
    In column C1 I entered =1*B
    which flagged the bad cell.
    The alternate is to use an auxiliary table like aux1
    In A1 I entered:
    =IF(ISERROR(INDIRECT(ADDRESS(ROW(),COLUMN(),,,"main"))),"",IF(ISBLANK(INDIRECT(A DDRESS(ROW(),COLUMN(),,,"main"))),"",1*INDIRECT(ADDRESS(ROW(),COLUMN(),,,"main") )))
    Exactly the same formula in B1, C1, D1, …
    So, the table will automatically grab the contents of the main table (just take care to insert more columns in aux1 than in main)
    In the footer row of aux1, insert a sum formula for columns where there is required.
    Looking at this footer will flag columns where a value may be "wrong" so, it will be necessary (but easy) to scan the column's content to find the red triangle(s).
    Yvan KOENIG (from FRANCE lundi 13 octobre 2008 13:27:40)

  • Run a formula if a cell contains particular data from various cells

    I have a formula which checks a list of domains to see what the TLD is and then returns a renewal price based on the TLD e.g. .co.uk may return with $5.99 and .com $10.00. The formula I am using is below:
    =VLOOKUP(RIGHT(A2,LEN(A2)−SEARCH(".",A2)+1),$A:$B,2,FALSE)
    I am now wanting to expand this formula to check additional criteria before running the above formula.
    I don't know what functions to use, but I know what I'm trying to achieve, so please, humour me when it comes to make believe syntax below:
    if a cell contains the data from a number of cells e.g. C$2:C$5 then run the above formula, if not return "N/A"

    Hi Ian,
    Thanks for your reply.
    I see exactly where you're going with this, but it's not exactly what I'm after.
    Perhaps I need to be a bit more clear in my explanation - my bad.
    Cell A2 has a domain name e.g. example.com, example.co.uk, example.org, example.net
    Cell B2 has a number of options to choose from e.g. Expire, Hosting, Backorder, Mapping
    Column D2:D5 have a number of TLDs e.g. co.uk, .com, .org, .net
    Column E2:E5 have the corresponding annual renewal prices for the TLDs listed in cells F2:F5
    Column F2:F5 have the options than can be chosen in column B2
    I only want to get the renewal price for the TLD where the option in Cell B2 is one of the options listed in cells F2:F5 and if it's not, I want it to return "N/A"

  • Check if a cell contains specific text

    I am trying to do a check to see if a cell contains specific text (but may also include other text). I thought this might be accomplished with an 'if' statement. Is this possible in Numbers?

    I am assuming the word "carrot" can appear multiple times within the same cell so the COUNTIF function will not work for this case.
    Set up an auxiliary (second) table that is the same size as your "matrix". Each cell in this new table corresponds to a cell in your "matrix". Each of these cells will count how many times "carrot" appears in the corresponding cell of the "matrix". The formula below will count how many times the letters "carrot" appear in that exact order in a cell. In other words, "carrotstick" is also included in the count. Capitalization is not a factor. It assumes your "matrix" top left corner is cell B2 of Table 1.
    Table 2 cell B2=(LEN(UPPER(Table 1 :: B2))-LEN(SUBSTITUTE(UPPER(Table 1 :: B2),UPPER($A$1),"")))/LEN($A$1)
    Copy or fill that formula to the rest of the cells.
    Table 2 cell A1 = carrot (the word you are looking for)
    Somewhere else have a cell that sums the cells in Table 2.
    The formula works by removing all instances of the word "carrot" from the string then subtracting the length of the new string from the length of the original and dividing that by the length of the word "carrot". The result is the number of times "carrot" appears in that particular string.
    You could put a space before and/or after "carrot" in cell A1 to avoid counting words such as "carrotstick" but if "carrot" is the first and/or last word of the string, it will not get counted because that space will not be there in the string.
    Message was edited by: Badunit

  • I have a column in a Numbers document that currently only contains a number--the numbers are different in different columns.  Before each number I want to add the words "Pack Qty."  How would I do this?

    I have a column in a Numbers document that currently contains a number and that number is different in different columns.  I want to add the words "Pack Qty" before each number in the column.  How do I do that?  I'm using Numbers '09 on a brand new Macbook Pro.  Thanks!

    In an adjacent column add the formula:
    ="Pack Qty: "&<CELL>
    where <CELL> is the cell in the same row where the quantity is,
    Like:
    E2="Pack Qty: "&D2
    select, and hold,  the little circle at the bottom right corner of the selction, then drag down

  • IllegalArgumentException: Cannot format given Object as a Number

    when I add a row( like Object row[]{"","",""}; )in JTable,and drag scrollbar to bottom;IDE will ouput exception info:
    java.lang.IllegalArgumentException: Cannot format given Object as a Number
    at java.text.NumberFormat.format(NumberFormat.java:219)
    at java.text.Format.format(Format.java:133)
    at javax.swing.JTable$DoubleRenderer.setValue(JTable.java:3397)
    at javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent(DefaultTableCellRenderer.java:160)
    at javax.swing.JTable.prepareRenderer(JTable.java:3731)
    at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)
    at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
    at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
    at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
    at javax.swing.JComponent.paintComponent(JComponent.java:541)
    at javax.swing.JComponent.paint(JComponent.java:808)
    at javax.swing.JViewport.blitDoubleBuffered(JViewport.java:1585)
    at javax.swing.JViewport.windowBlitPaint(JViewport.java:1551)
    at javax.swing.JViewport.setViewPosition(JViewport.java:1082)
    at javax.swing.plaf.basic.BasicScrollPaneUI$VSBChangeListener.stateChanged(BasicScrollPaneUI.java:476)
    at javax.swing.DefaultBoundedRangeModel.fireStateChanged(DefaultBoundedRangeModel.java:346)
    at javax.swing.DefaultBoundedRangeModel.setRangeProperties(DefaultBoundedRangeModel.java:283)
    at javax.swing.DefaultBoundedRangeModel.setValue(DefaultBoundedRangeModel.java:149)
    at javax.swing.JScrollBar.setValue(JScrollBar.java:435)
    at javax.swing.plaf.basic.BasicScrollBarUI$TrackListener.setValueFrom(BasicScrollBarUI.java:1033)
    at javax.swing.plaf.basic.BasicScrollBarUI$TrackListener.mouseDragged(BasicScrollBarUI.java:992)
    at java.awt.Component.processMouseMotionEvent(Component.java:5148)
    at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2779)
    at java.awt.Component.processEvent(Component.java:4901)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3215)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    what's wrong?

    My bet is that it can't format the given Object as a number.
    Source? Line that fails? Extra potato chips?

  • Convert contents of a formatted excel cell to HTML format

    Hi All,
    Background: I am writing a script that uploads some test cases written in excel into Quality Center. For those who are familiar with the QC Excel Addin, this script would do a pretty similar job except for reducing
    the steps involved. I'm using Office 2007 running on Win 7 Pro.
    Need: I have a situation where the contents of a formatted excel cell need to be converted to HTML tags representing the same formattin in the excel cell. For example a cell containg the text: "Verify
    if help topics in Macro section are
    hyperlinked" should be converted to
    <html><b>Verify</b> if help topics in <u>Macro section</u> are <i>hyperlinked</i></html> 
    Question: Is there an inbuilt function in Excel/VBAn accomplish this? Or is a macro required? Any other ideas to accomplish this?
    Note: Whatever used for converting (an inbuilt function or a macro) should support new line characters and colors.
    Any help or redirection to solutions is appreciated.
    Thanks, John.
    --Thanks, John Jacob Tharakan

    Here is the function I wrote. This handles the conversion character by character.
    Function fnConvert2HTML(myCell As Range) As String
    Dim bldTagOn, itlTagOn, ulnTagOn, colTagOn As Boolean
    Dim i, chrCount As Integer
    Dim chrCol, chrLastCol, htmlTxt As String
    bldTagOn = False
    itlTagOn = False
    ulnTagOn = False
    colTagOn = False
    chrCol = "NONE"
    htmlTxt = "<html>"
    chrCount = myCell.Characters.Count
    For i = 1 To chrCount
    With myCell.Characters(i, 1)
    If (.Font.Color) Then
    chrCol = fnGetCol(.Font.Color)
    If Not colTagOn Then
    htmlTxt = htmlTxt & "<font color=#" & chrCol & ">"
    colTagOn = True
    Else
    If chrCol <> chrLastCol Then htmlTxt = htmlTxt & "</font><font color=#" & chrCol & ">"
    End If
    Else
    chrCol = "NONE"
    If colTagOn Then
    htmlTxt = htmlTxt & "</font>"
    colTagOn = False
    End If
    End If
    chrLastCol = chrCol
    If .Font.Bold = True Then
    If Not bldTagOn Then
    htmlTxt = htmlTxt & "<b>"
    bldTagOn = True
    End If
    Else
    If bldTagOn Then
    htmlTxt = htmlTxt & "</b>"
    bldTagOn = False
    End If
    End If
    If .Font.Italic = True Then
    If Not itlTagOn Then
    htmlTxt = htmlTxt & "<i>"
    itlTagOn = True
    End If
    Else
    If itlTagOn Then
    htmlTxt = htmlTxt & "</i>"
    itlTagOn = False
    End If
    End If
    If .Font.Underline > 0 Then
    If Not ulnTagOn Then
    htmlTxt = htmlTxt & "<u>"
    ulnTagOn = True
    End If
    Else
    If ulnTagOn Then
    htmlTxt = htmlTxt & "</u>"
    ulnTagOn = False
    End If
    End If
    If (Asc(.Text) = 10) Then
    htmlTxt = htmlTxt & "<br>"
    Else
    htmlTxt = htmlTxt & .Text
    End If
    End With
    Next
    If colTagOn Then
    htmlTxt = htmlTxt & "</font>"
    colTagOn = False
    End If
    If bldTagOn Then
    htmlTxt = htmlTxt & "</b>"
    bldTagOn = False
    End If
    If itlTagOn Then
    htmlTxt = htmlTxt & "</i>"
    itlTagOn = False
    End If
    If ulnTagOn Then
    htmlTxt = htmlTxt & "</u>"
    ulnTagOn = False
    End If
    htmlTxt = htmlTxt & "</html>"
    fnConvert2HTML = htmlTxt
    End Function
    Function fnGetCol(strCol As String) As String
    Dim rVal, gVal, bVal As String
    strCol = Right("000000" & Hex(strCol), 6)
    bVal = Left(strCol, 2)
    gVal = Mid(strCol, 3, 2)
    rVal = Right(strCol, 2)
    fnGetCol = rVal & gVal & bVal
    End Function
    --Thanks, John Jacob Tharakan

  • Excel Mac £ sign keeps reverting to $ sign on saving file even when I have formatted the cells and checked the preferences

    Excel Mac - £ sign keeps reverting to $ sign on saving even though I have formatted the cells correctly to £ and in the preferences too?

    Please can you type me a response to my question. I cannot find it http://answers.microsoft.com/en-us/mac/forum/macexcel here.
    Thank you.

  • I format a cell with a double line at the bottom and it appears until I move to another cell and the formatting is lost.

    In Numbers, I format a cell with a double line at the bottom and it appears until I clik on another cell and then it disappears.

    When you describe the "double" line are you talking about something like this?
    If so this is only selecting an edge of a cell.  You still have to select:
    1) Line style using the menu to the right of the one I have circled (currently  "Thin")
    2) Line width using the menu to the right of the previous one and, finally,
    3) the line color using the menu to the right of the previous one
    Even so I have not found a way to copy cell border formatting so I ALWAYS wait until the very end to add border formatting.

  • Can't drag down a cell containing formula

    I've created a simple balance sheet (incoming outgoing) as I've done many times before.
    I can't drag down a cell containing the formula which creates the total balance, which I normally do by clicking on the cell, hovering over the bottom right hand corner until the + appears and then drag that down to cells below, which usually continues the formula.
    Here's the thing - I used to be able to do this in this document and I still can in another group of cells within the same document. It appears that this cell has become locked.
    I've tried deleting the entire column and starting from the top, but again, it won't drag down.
    Any ideas?
    Thanks in anticipation.
    Phil

    Hello
    Having the sheet in front of me gives the soluce.
    You merged cells from column F and cells from column G.
    When this is done we can't use the fill down feature.
    Use Split into Columns to separate cells F from cells G and you will get the original behaviour
    Yvan KOENIG (from FRANCE vendredi 18 avril 2008 16:47:49)

  • Format a cell in Numbers

    I select some cells, choose the format but I don't see how to apply the format.  I'm obviously missing something.

    Hi Harvey,
    What format do you want?
    After selecting the cells, Format Panel > Cell > Data Format
    Please call back if this does not help.
    Regards,
    Ian.

  • How to judge whether the chars contain only number and letter

    how to judge whether the chars contain only number and letter, for example :
    'AEs4386' is valid , but '‘´‘¼ew78' is not
    thanks for your help !

    Hi,
    try the following:
    data: l_test(36) type c.
    concatenate sy-abcde '0123456789' into l_test.
    l_test contains all letters all numbers now
    translate YourVariable to upper case.
    YourVariable contains only upper case letters
    check YourVariable co l_test. " or use if instead of check
    YourVariable contains only letters or numbers
    regards
    Siggi

Maybe you are looking for

  • Multiple Branded Login Pages

    Hi I followed the plumtree enterprise dev tutorial on the plumtree site on multiple branding using different url host headers, using custom activity spaces and PEI, making calls when login action events are triggered. It works for the most part, exce

  • Split Valuation Material Cost Estimate into COPA

    Hi all, Is there any way how we can transfer the split valuation material cost estimate into COPA? I checked the actual line items, there is no "valuation type / batch" characteristics there. Is this the main cause? Please kindly suggest on the best

  • Can anyone explain why a different Apple Id pops up

    when I use the iCloud back-up to restore a new device. My own Apple Id comes up so I type in my passwor...that's not the problem..but... while it is downloading all of my apps and contents from my icloud back-up to my new device, another Apple ID pop

  • Repeat transportorder confirmation - update delivery notes

    Hello everyone, Transport orders (WM) - based on delivery's - have been created and were confirmed. Unfortunately the corresponding update of delivery notes failed. (e.g. VBFA, LIPS not updeated). We are searching desperately for a solution to redo t

  • Turning app into exe?

    Hi all, i've created myself a java shell type thing which allows me to launch various progs. Just wondering how do i go about turning this application into an exe file as i'd like it on the desktop, and it would be useful for some of the other progra