Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Formatting Number & Text in same cell

Hello,

Could someone please advise on how to format text & numbers in the same cell
as shown below:

I want the following format as shown in the examples given:

Example 1: 019 APR
Example 2: 530 OCT

The user may enter the information in a number of ways as shown in the
examples shown below:

Example 1: 019APR
Example 2: 19APR
Example 3: 019 APR
Example 4: 19 APR

Any help would be greatly appreciated,

Kind regards,

Chris.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Formatting Number & Text in same cell

I'd use a helper cell and another cell to display the result.

Say the value is in A1. Then in B1, I'd put this formula:
=LEFT(MATCH(FALSE,ISNUMBER(-MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),0))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Then in the result cell (C1 for me), I'd use this formula:
=TEXT(--LEFT(A1,B1-1),"000")&" "&MID(A1,B1,255)



Chris Hankin wrote:

Hello,

Could someone please advise on how to format text & numbers in the same cell
as shown below:

I want the following format as shown in the examples given:

Example 1: 019 APR
Example 2: 530 OCT

The user may enter the information in a number of ways as shown in the
examples shown below:

Example 1: 019APR
Example 2: 19APR
Example 3: 019 APR
Example 4: 19 APR

Any help would be greatly appreciated,

Kind regards,

Chris.


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Formatting Number as Text klafert Excel Worksheet Functions 5 January 6th 10 05:38 PM
Formatting from Number to Text FredL Excel Discussion (Misc queries) 4 December 8th 06 02:52 PM
formatting cell number based on previous cell number Pasquini Excel Discussion (Misc queries) 3 June 20th 06 06:36 AM
formatting number value to text value in excel jazzydwit Excel Worksheet Functions 2 December 29th 05 03:17 AM
Formatting a cell as "text" in the number catagory. Ed Excel Worksheet Functions 3 December 7th 04 07:12 PM


All times are GMT +1. The time now is 12:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"