Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Emsmaps
 
Posts: n/a
Default IF formula in Excel / Replace numbers with 'words'


Hey there,

I got the following table: see below

Now what I want to do, is to replace the numbers with words.

In words this would look something like this

FOR ROW Q:

If Value'Q' = 1 replace by A
If Value'Q' = 2 replace by B

FOR ROW R:

If Value'Q' = 1 and Value 'R' = 1 replace by aa
If Value'Q' = 1 and Value 'R' = 2 repalce by aa'
If Value'Q' = 2 and Value 'R' = 1 replace by bb

etc ...

I hope this explains it.

Cheers and thx a lot.

Philipp


+-------------------------------------------------------------------+
|Filename: TABLE1.JPG |
|Download: http://www.excelforum.com/attachment.php?postid=4599 |
+-------------------------------------------------------------------+

--
Emsmaps
------------------------------------------------------------------------
Emsmaps's Profile: http://www.excelforum.com/member.php...o&userid=33265
View this thread: http://www.excelforum.com/showthread...hreadid=530880

  #2   Report Post  
Posted to microsoft.public.excel.misc
Bryan Hessey
 
Posts: n/a
Default IF formula in Excel / Replace numbers with 'words'


I guess the two difficulties are that 1) Excel doesn't replace other
cell values unless you use VB code, and 2) in a 2 part test, if
Value'Q' were replaced then value R would fail the test because value Q
was no longer a 1 or 2, therefore the test is failed, therefore the Q
value should not have been changed (or something like that)

So, instead of 'changing' the values, I would use a second sheet and in
cell A1 put:

=IF(Sheet1!A1="","",Sheet1!A1)

and formula-drag that across and down to cover all required cells.

This would give me an active copy. (ie, if you change Sheet1 it will be
reflected here)

Then, for the required Q row, in cell Q1 use

=IF(Sheet1!Q1="","",if(Sheet1!Q1=1,"A",Sheet1!Q1))

and formula drag that across for the number of cells required to be
changed,

and for row R, in cell R1 put


=IF(Sheet1!R1="","",IF(AND(Sheet1!Q1=1,Sheet1!R1=1 ),"aa",IF(AND(Sheet1!Q1=1,Sheet1!R1=2),"aa'",IF(AN D(Sheet1!Q1=2,Sheet1!R1=1),"bb",Sheet1!R1))))

and formula drag that down to cover all required cells.

This should provide the look you require.

-Note, when you copy and paste these formula, watch for inserted spaces
and remove them. -
--



Emsmaps Wrote:
Hey there,

I got the following table: see below

Now what I want to do, is to replace the numbers with words.

In words this would look something like this

FOR ROW Q:

If Value'Q' = 1 replace by A
If Value'Q' = 2 replace by B

FOR ROW R:

If Value'Q' = 1 and Value 'R' = 1 replace by aa
If Value'Q' = 1 and Value 'R' = 2 repalce by aa'
If Value'Q' = 2 and Value 'R' = 1 replace by bb

etc ...

I hope this explains it.

Cheers and thx a lot.

Philipp



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=530880

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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
How do I replace a "#N/A" formula result with a blank in excel? yrat Excel Discussion (Misc queries) 6 April 3rd 06 04:38 AM
How do I replace negative numbers with zero in Excel. A Blaylock Excel Worksheet Functions 0 March 16th 06 09:08 PM
How do I convert numbers to words (1000 to One Thousand) in Excel Paul Excel Discussion (Misc queries) 1 September 14th 05 08:20 PM
Is there a formula to convert numbers to written text in Excel? LZC Excel Worksheet Functions 3 November 27th 04 08:10 PM


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

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

About Us

"It's about Microsoft Excel"