+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Cell Format

  1. #1
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Cell Format

    Cell A1 displays the output of various different cells on a worksheet, however the information in the other cells can be formatted as either a number or as a percentage, e.g. Cell C1 may = 23,452, where as Cell D1 may = 79.23%.

    How can I maintain the correct format for the figure displayed in Cell A1, i.e., when A1 displays the contents of C1, I want it to display as a number and when A1 displays the contents of D1, I want it to display as a percentage without having to change the cell format for cell A1? I want cell A1 to display 79.23% and not 0.7923!

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Cell Format

    Hi HangMan,

    You can use Text function here... when A1 displays the content of c1, use =TEXT(c1,"00,000") and when A1 displays the content of d1, use =TEXT(F8,"0.00%")... this kind of formulation can be triggered using the logic which triggers the use of A1 and C1. thanks.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Cell Format

    Hi DILIPandey,

    I'm not sure I follow. Doesn't this mean you would constantly have to change the format of Cell A1? I want to keep one format for Cell A1 but somehow allow it to display either numbers or percentages e.g. a number would be dispalyed as 23,462 and a percentage as 79.32% (rather than as 0.7932). I don't know if this makes sense?

    Can you elaborate a little as to how to use the Text function, as I'm not sure how this would be implemented?

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Cell Format

    Hi HangMan,

    That is perfectly making sense... and that is where I have suggested Text function to control the format appearances :-

    You can use text function as :- =TEXT(reference,"0.00%") to display the result in percentage - as an example.. for other formats available and how to use them, suggest you to see the help feature of Ms excel on this function

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,812

    Re: Cell Format

    Hangman,

    you can apply this custom number format to cell A1:

    [>1] #,##0;[<=1]##0.0%

    so that anything larger than 1 is displayed as a number with no decimal places, whereas anything less than 1 is shown as a percentage with 1 dp. The attached file shows this in action - just type something in A1 like =C1 or =D1 or even just a number to see the effect. You can use the Format Painter icon to apply that format to other cells.

    Hope this helps.

    Pete
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Cell Format

    DILIPandey,

    Many thnaks for your input. I couldn't see how your solution would work in practice as it seemed to me that I would have to constantly change the format of cell A1, but many thanks for your input and help. Pete_UK's solution is exactly what I was looking for...

  7. #7
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Cell Format

    Hi Pete_UK,

    Perfect solution, many thanks, that works a treat...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1