Excel Formatting Numbers in Cell

Neil

I have a column of data in Excel;

07902555018   
07902556019   
07902557020   
07902558021   
07902559022   
...  

The values change but the placement of three zeros is constant. I am trying to remove the First Zero, Second Zero and the Zero in the 3rd to last position.

792555518   
792555619  
792555720
...   

After the values are changed I am trying to add two hyphens

79-25555-18  
79-25556-19  
19-25557-20 

I tried using: =TEXT(--SUBSTITUTE(--E2,"0","",2),"00-00000-00") However a problem occurs:

079020638020 becomes 792-06380-20 However 79-20638-20 is the value I want returned in instances like these.

CallumDA

If you only know that the placement of the zeros is constant then use REPLACE rather than SUBSTITUTE. This replaces (removes) the 1st, 4th and 9th zeros:

=TEXT(REPLACE(REPLACE(REPLACE(A1,1,1,""),3,1,""),8,1,""),"00-00000-00")

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Excel 2010 Cell Formatting

From Dev

Excel cell color formatting

From Dev

excel assign the value and formatting of a cell

From Dev

Formatting in cell depending on row in Excel

From Dev

Excel: copy cell formatting in equation

From Dev

Formatting in cell depending on row in Excel

From Dev

Excel IF statement conditional cell formatting

From Dev

How to programmatically apply conditional formatting on a cell range with numbers using Excel COM Interop?

From Dev

VBA Excel formatting numbers to strings

From Dev

Formatting numbers in excel so they are in parentheses

From Dev

VBA Excel formatting numbers to strings

From Dev

Conditional formatting cell x numbers of columns to the left

From Dev

(Excel) Conditional Formatting based on Adjacent Cell Value

From Dev

Clear contents and formatting of an Excel cell with a single command

From Dev

Excel conditional formatting only applies to first cell

From Dev

Conditional Formatting in Excel with Formula Current Cell

From Dev

VBA Excel Cell formatting on specific days on open

From Dev

Excel conditional formatting based on cell content

From Dev

Excel Conditional Formatting based on Previous Cell

From Dev

Excel conditional formatting with multiple cell comparison

From Dev

Clear contents and formatting of an Excel cell with a single command

From Dev

Excel: Different formatting on different values in same cell

From Dev

Conditional formatting using cell styles in Excel 2007?

From Dev

Excel Conditional Formatting (Range vs single cell)

From Dev

Excel VBA copy cell formatting to range

From Dev

Adding numbers to cell references in Excel

From Dev

overflow numbers to another cell in excel

From Dev

Excel custom cell formatting: formatting code for alphanumerical entry with spaces?

From Dev

Formatting numbers in excel in a 3 value currency

Related Related

  1. 1

    Excel 2010 Cell Formatting

  2. 2

    Excel cell color formatting

  3. 3

    excel assign the value and formatting of a cell

  4. 4

    Formatting in cell depending on row in Excel

  5. 5

    Excel: copy cell formatting in equation

  6. 6

    Formatting in cell depending on row in Excel

  7. 7

    Excel IF statement conditional cell formatting

  8. 8

    How to programmatically apply conditional formatting on a cell range with numbers using Excel COM Interop?

  9. 9

    VBA Excel formatting numbers to strings

  10. 10

    Formatting numbers in excel so they are in parentheses

  11. 11

    VBA Excel formatting numbers to strings

  12. 12

    Conditional formatting cell x numbers of columns to the left

  13. 13

    (Excel) Conditional Formatting based on Adjacent Cell Value

  14. 14

    Clear contents and formatting of an Excel cell with a single command

  15. 15

    Excel conditional formatting only applies to first cell

  16. 16

    Conditional Formatting in Excel with Formula Current Cell

  17. 17

    VBA Excel Cell formatting on specific days on open

  18. 18

    Excel conditional formatting based on cell content

  19. 19

    Excel Conditional Formatting based on Previous Cell

  20. 20

    Excel conditional formatting with multiple cell comparison

  21. 21

    Clear contents and formatting of an Excel cell with a single command

  22. 22

    Excel: Different formatting on different values in same cell

  23. 23

    Conditional formatting using cell styles in Excel 2007?

  24. 24

    Excel Conditional Formatting (Range vs single cell)

  25. 25

    Excel VBA copy cell formatting to range

  26. 26

    Adding numbers to cell references in Excel

  27. 27

    overflow numbers to another cell in excel

  28. 28

    Excel custom cell formatting: formatting code for alphanumerical entry with spaces?

  29. 29

    Formatting numbers in excel in a 3 value currency

HotTag

Archive