Smekeri BezPrezimena
Smekeri BezPrezimena

Reputation: 53

Excel: Two different custom format into one cell

How to concatenate two different custom format into one cell.

1: [>10 numbers]0##"/"###-##-## Example: 061/1111-22-33

2: [<10 numbers]0##"/"###-### Example: 061/111-222

Upvotes: 0

Views: 846

Answers (2)

Dmitrij Holkin
Dmitrij Holkin

Reputation: 2055

Something like that

[>999999999]"0"#"/"####-##-##;[<=999999999]"0"##"/"###-###

enter image description here

Upvotes: 1

JvdV
JvdV

Reputation: 75930

Just create two conditional formatting rules:

  • Select the specific cell, or whole column if you want (in this example A1)
  • Click on Conditional formatting button -> New rule
  • Use formula: =LEN(A1)>=10
  • Use custom format: 0##"/"###-##-##

Repeat the process for formula:

  • =LEN(A1)<10 with custom format 0##"/"###-###

Upvotes: 1

Related Questions