LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Nested Search and Replace

I have a worksheet with one column which contains numerous GL account
codes suchs as:

001-400010-00-11000
001-400010-00-12000
001-500000-00-10000
001-500000-00-10234
001-500000-00-11000
001-500000-00-11003

Basically, I need to make change to the number and output the change
in column b. The numbers that end in "-10000" I need to now end with
10234, those ending with "11000" need to end with 11003, and 12000
need to end with 12003.

I am trying a formula like this:
=IF(SEARCH("-00000",A53),REPLACE(A53,15,5,10234),
IF(SEARCH("-10000",A53),REPLACE(A53,15,5,10234),
IF(SEARCH("-11000",A53),REPLACE(A53,15,5,11003),
IF(SEARCH("-12000",A53),REPLACE(A53,15,5,12003),A53))))

My intent should be clear by the formula above. If it ends with 00000
change that to 10234, ending in 10000 change to 10234 and so on. If
nothing matches then just leave it as is.

As I drag the formula down it works for anything ending with -00000
but nothing else gets anything other than #VALUE!

Any thoughts how I can accomplish this with a formula...
 
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
Nested String Search and Return Value. Saurabh Khanna.[_2_] Excel Discussion (Misc queries) 2 December 18th 09 06:19 AM
Nested if text search jims2994 Excel Discussion (Misc queries) 2 June 4th 08 08:44 PM
Limit to nested IF(ISNUMBER(SEARCH)) functions? Jonathan Horvath Excel Worksheet Functions 22 June 25th 07 08:04 PM
Can COUNTIF be nested to search two ranges Jimbob Excel Worksheet Functions 4 November 1st 06 05:23 PM
Search and Replace LymaBeane Excel Worksheet Functions 2 September 13th 06 10:30 PM


All times are GMT +1. The time now is 05:27 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"