Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Excel - convert data into text

I wish to assign text to data values - for example if a cell contains 3.1
then I wish it to given the text equivalent 3c, 3.5 given 3b, 3.9 given 3a,
4.1 given 4c, 4.5 given 4b etc..
All this needs to be done in a seperate column next to the original data
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Excel - convert data into text

Assuming the data is in column A
=IF(RIGHT(A1,1)="1",A1&"c",IF(RIGHT(A1,1)="5",A1&" b",IF(RIGHT(A1,1)="9",A1&"a","")))

Now this only handles the .1, .5, and .9 as specified
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"John Mac" wrote:

I wish to assign text to data values - for example if a cell contains 3.1
then I wish it to given the text equivalent 3c, 3.5 given 3b, 3.9 given 3a,
4.1 given 4c, 4.5 given 4b etc..
All this needs to be done in a seperate column next to the original data

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Excel - convert data into text

Try this
=INT(A1)&CHOOSE(MOD(A1*10,10)+1,"x","c","x","x","x ","b","x","x","x","a")
I intially used MOD(A1,1) but this gave round-off errors
happy new year
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"John Mac" <John wrote in message
...
I wish to assign text to data values - for example if a cell contains 3.1
then I wish it to given the text equivalent 3c, 3.5 given 3b, 3.9 given
3a,
4.1 given 4c, 4.5 given 4b etc..
All this needs to be done in a seperate column next to the original data



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Excel - convert data into text

Many thanks, that has worked but what I now need is for the decimal place to
be replaced by the letter eg 5.5 becomes 5b

"John Bundy" wrote:

Assuming the data is in column A
=IF(RIGHT(A1,1)="1",A1&"c",IF(RIGHT(A1,1)="5",A1&" b",IF(RIGHT(A1,1)="9",A1&"a","")))

Now this only handles the .1, .5, and .9 as specified
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"John Mac" wrote:

I wish to assign text to data values - for example if a cell contains 3.1
then I wish it to given the text equivalent 3c, 3.5 given 3b, 3.9 given 3a,
4.1 given 4c, 4.5 given 4b etc..
All this needs to be done in a seperate column next to the original data

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Excel - convert data into text

No problem, just a long chunk
=IF(RIGHT(A1,1)="1",LEFT(A1,LEN(A1)-1)&"c",IF(RIGHT(A1,1)="5",LEFT(A1,LEN(A1)-1)&"b",IF(RIGHT(A1,1)="9",LEFT(A1,LEN(A1)-1)&"a","")))

This makes it 3.a

=IF(RIGHT(A1,1)="1",LEFT(A1,LEN(A1)-2)&"c",IF(RIGHT(A1,1)="5",LEFT(A1,LEN(A1)-2)&"b",IF(RIGHT(A1,1)="9",LEFT(A1,LEN(A1)-2)&"a","")))

This is 3a
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"John Mac" wrote:

Many thanks, that has worked but what I now need is for the decimal place to
be replaced by the letter eg 5.5 becomes 5b

"John Bundy" wrote:

Assuming the data is in column A
=IF(RIGHT(A1,1)="1",A1&"c",IF(RIGHT(A1,1)="5",A1&" b",IF(RIGHT(A1,1)="9",A1&"a","")))

Now this only handles the .1, .5, and .9 as specified
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"John Mac" wrote:

I wish to assign text to data values - for example if a cell contains 3.1
then I wish it to given the text equivalent 3c, 3.5 given 3b, 3.9 given 3a,
4.1 given 4c, 4.5 given 4b etc..
All this needs to be done in a seperate column next to the original data



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Excel - convert data into text

Thanks Bernard - I see what you mean about round off errors. This has worked
brilliantly!
Sorry another question - if I am averaging a set of data and only want the
answer to have the decimal place of either .1, .5, or .9 how can I round off
the answer to the nearest of those required decimal places?

"Bernard Liengme" wrote:

Try this
=INT(A1)&CHOOSE(MOD(A1*10,10)+1,"x","c","x","x","x ","b","x","x","x","a")
I intially used MOD(A1,1) but this gave round-off errors
happy new year
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"John Mac" <John wrote in message
...
I wish to assign text to data values - for example if a cell contains 3.1
then I wish it to given the text equivalent 3c, 3.5 given 3b, 3.9 given
3a,
4.1 given 4c, 4.5 given 4b etc..
All this needs to be done in a seperate column next to the original data




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Excel - convert data into text

Many thanks for your help - have a good New Year

"John Bundy" wrote:

No problem, just a long chunk
=IF(RIGHT(A1,1)="1",LEFT(A1,LEN(A1)-1)&"c",IF(RIGHT(A1,1)="5",LEFT(A1,LEN(A1)-1)&"b",IF(RIGHT(A1,1)="9",LEFT(A1,LEN(A1)-1)&"a","")))

This makes it 3.a

=IF(RIGHT(A1,1)="1",LEFT(A1,LEN(A1)-2)&"c",IF(RIGHT(A1,1)="5",LEFT(A1,LEN(A1)-2)&"b",IF(RIGHT(A1,1)="9",LEFT(A1,LEN(A1)-2)&"a","")))

This is 3a
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"John Mac" wrote:

Many thanks, that has worked but what I now need is for the decimal place to
be replaced by the letter eg 5.5 becomes 5b

"John Bundy" wrote:

Assuming the data is in column A
=IF(RIGHT(A1,1)="1",A1&"c",IF(RIGHT(A1,1)="5",A1&" b",IF(RIGHT(A1,1)="9",A1&"a","")))

Now this only handles the .1, .5, and .9 as specified
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"John Mac" wrote:

I wish to assign text to data values - for example if a cell contains 3.1
then I wish it to given the text equivalent 3c, 3.5 given 3b, 3.9 given 3a,
4.1 given 4c, 4.5 given 4b etc..
All this needs to be done in a seperate column next to the original data

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Excel - convert data into text

Thus does it
=INT(A1)+CHOOSE(MOD(A1*10,10)+1,1,1,1,5,5,5,5,9,9, 9)/10
but you will need to change to 1,1,1,.....9 part to fit YOUR rules
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"John Mac" wrote in message
...
Thanks Bernard - I see what you mean about round off errors. This has
worked
brilliantly!
Sorry another question - if I am averaging a set of data and only want the
answer to have the decimal place of either .1, .5, or .9 how can I round
off
the answer to the nearest of those required decimal places?

"Bernard Liengme" wrote:

Try this
=INT(A1)&CHOOSE(MOD(A1*10,10)+1,"x","c","x","x","x ","b","x","x","x","a")
I intially used MOD(A1,1) but this gave round-off errors
happy new year
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"John Mac" <John wrote in message
...
I wish to assign text to data values - for example if a cell contains
3.1
then I wish it to given the text equivalent 3c, 3.5 given 3b, 3.9 given
3a,
4.1 given 4c, 4.5 given 4b etc..
All this needs to be done in a seperate column next to the original
data






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
Sumproduct issues SteveDB1 Excel Worksheet Functions 25 June 3rd 09 04:58 PM
Copying Data from Excel to MS Outlook in Plain Text Mode JohnGuts Excel Worksheet Functions 0 July 30th 06 09:57 PM
How to Transfer data from Text Form Fields in MS Word into Excel? CWillis Excel Discussion (Misc queries) 1 July 18th 06 06:35 AM
From several workbooks onto one excel worksheet steve Excel Discussion (Misc queries) 6 December 1st 05 08:03 AM
get SQL Server text data type into Excel pivot table Lee@360Commerce Excel Discussion (Misc queries) 0 August 19th 05 11:37 PM


All times are GMT +1. The time now is 03:02 PM.

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"