PC Review


Reply
Thread Tools Rate Thread

How can you replace specific characters in a string ?

 
 
exceluser
Guest
Posts: n/a
 
      28th Aug 2010
How can you replace specific characters in a string ?

Date Product Qty Inventory
1/1/2010 Apples 1 Apples(1)
1/2/2010 Oranges 2 Apples(1),Oranges(2)
1/3/2010 Apples 7 Apples(7),Oranges(2)
1/4/2010 Apples 0 Oranges(2)


On 1/1/2010, the inventory consisted of 1 apple.

On 1/2/2010, the inventory consisted of 1 apple and 2 oranges.

On 1/3/2010, the inventory consisted of 7 apples and 2 oranges.

On 1/4/2010, the inventory consisted of 2 oranges.

I have a formula that determines which items are in the Inventory
column. For example, on 1/2/2010, the Inventory column reflects
Apples, Oranges.

The next step is to append to each item its quantity. For example, on
1/2/2010, the Inventory column should reflect Apples(1),Oranges(2).

However, I haven’t been able to figure out how to replace Apples(1)
with Apples(7) on 1/3/2010 or how to remove Apples(7) on 1/4/2010 from
the Inventory column.


Exceluser
 
Reply With Quote
 
 
 
 
exceluser
Guest
Posts: n/a
 
      28th Aug 2010
On Aug 27, 9:01*pm, exceluser <ifmcqy7aias...@yahoo.com> wrote:
> How can you replace specific characters in a string ?
>
> Date * *Product Qty * * Inventory
> 1/1/2010 * * * *Apples *1 * * * Apples(1)
> 1/2/2010 * * * *Oranges 2 * * * Apples(1),Oranges(2)
> 1/3/2010 * * * *Apples *7 * * * Apples(7),Oranges(2)
> 1/4/2010 * * * *Apples *0 * * * Oranges(2)
>
> On 1/1/2010, the inventory consisted of 1 apple.
>
> On 1/2/2010, the inventory consisted of 1 apple and 2 oranges.
>
> On 1/3/2010, the inventory consisted of 7 apples and 2 oranges.
>
> On 1/4/2010, the inventory consisted of 2 oranges.
>
> I have a formula that determines which items are in the Inventory
> column. For example, on 1/2/2010, the Inventory column reflects
> Apples, Oranges.
>
> The next step is to append to each item its quantity. For example, on
> 1/2/2010, the Inventory column should reflect Apples(1),Oranges(2).
>
> However, I haven’t been able to figure out how to replace Apples(1)
> with Apples(7) on 1/3/2010 or how to remove Apples(7) on 1/4/2010 from
> the Inventory column.
>
> Exceluser


I figured it out.

The solution involved using SEARCH, REPLACE and SUBSTITUTE.



Exceluser
 
Reply With Quote
 
Don Guillett Excel MVP
Guest
Posts: n/a
 
      28th Aug 2010
On Aug 28, 3:17*am, exceluser <ifmcqy7aias...@yahoo.com> wrote:
> On Aug 27, 9:01*pm, exceluser <ifmcqy7aias...@yahoo.com> wrote:
>
>
>
>
>
> > How can you replace specific characters in a string ?

>
> > Date * *Product Qty * * Inventory
> > 1/1/2010 * * * *Apples *1 * * * Apples(1)
> > 1/2/2010 * * * *Oranges 2 * * * Apples(1),Oranges(2)
> > 1/3/2010 * * * *Apples *7 * * * Apples(7),Oranges(2)
> > 1/4/2010 * * * *Apples *0 * * * Oranges(2)

>
> > On 1/1/2010, the inventory consisted of 1 apple.

>
> > On 1/2/2010, the inventory consisted of 1 apple and 2 oranges.

>
> > On 1/3/2010, the inventory consisted of 7 apples and 2 oranges.

>
> > On 1/4/2010, the inventory consisted of 2 oranges.

>
> > I have a formula that determines which items are in the Inventory
> > column. For example, on 1/2/2010, the Inventory column reflects
> > Apples, Oranges.

>
> > The next step is to append to each item its quantity. For example, on
> > 1/2/2010, the Inventory column should reflect Apples(1),Oranges(2).

>
> > However, I haven’t been able to figure out how to replace Apples(1)
> > with Apples(7) on 1/3/2010 or how to remove Apples(7) on 1/4/2010 from
> > the Inventory column.

>
> > Exceluser

>
> I figured it out.
>
> The solution involved using SEARCH, REPLACE and SUBSTITUTE.
>
> Exceluser- Hide quoted text -
>
> - Show quoted text -


For archival purposes post YOUR solution.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
replace characters in a string kenny.love@gmail.com Microsoft Access Forms 2 30th Aug 2006 01:50 PM
Replace certain characters in a string Fred Boer Microsoft Access VBA Modules 3 15th Aug 2006 11:06 PM
Replace characters in a string jpierson@gmail.com Microsoft C# .NET 4 25th Mar 2006 11:57 PM
Quickest way to replace characters in a string Ivor Microsoft Access Macros 1 14th Sep 2004 07:39 PM
Re: Replace specific characters within formula Debra Dalgleish Microsoft Excel Misc 0 26th Jul 2003 02:04 AM


Features
 

Advertising
 

Newsgroups
 


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