count terms in a cell

[...]

Is it possible now to point to any ward in a cell and switch between words ?
Example: A1 houses "Mr Excel Message Board"
New order: "Mr Excel Board Message"
[...]

Not fully tested but see...
Book2
ABCD
1
2MrExcelMessageBoardBoardMrExcelBoardMessageMrExcel
3MrExcelMessageBoardBoardBoardMrExcelMessageBoard
4MrExcelMessageBoardMrExcelBoardBoardMessageMrExcel
5MrExcelMessageBoardMrExcelMessageMessageMrExcelBoard
6MrExcelMessageBoardBoardMessageMrExcelBoardMessage
7
Sheet1


The essential formula is...

=IF(B2<>C2,SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,B2,"@"),C2,B2),SUBSTITUTE(A2,B2,"@"),C2),"@",C2),A2)

where A2 houses an input sentence, B2 and C2 are words that must be exchanged.

Note. I did not seek to shorten it.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I have have need for this sort of stuff, was so happy to stumble upon the Microsoft page where code to simulate Split(), Replace(), Join(), etc was offered.

As newbie programmer many years ago, I was worried about math functions. Now it seems to me what really matters is the string functions you DON'T have to recreate.
 
Upvote 0
Hi
=SUBSTITUTE(SUBSTITUTE(A1,"First_word","Second_Word"),"Second_Word","First_word",2
)

Instead using the word you use a formula so it could fitt for any word

Zvika
 
Upvote 0
Hi
=SUBSTITUTE(SUBSTITUTE(A1,"First_word","Second_Word"),"Second_Word","First_word",2
)

Instead using the word you use a formula so it could fitt for any word

Zvika
 
Upvote 0
On 2002-10-21 12:43, zvika_1 wrote:
Hi
=SUBSTITUTE(SUBSTITUTE(A1,"First_word","Second_Word"),"Second_Word","First_word",2
)

Instead using the word you use a formula so it could fitt for any word

Zvika

Hi,

Did you apply your "Instead using the word you use a formula so it could fitt for any word" to the table I published?
 
Upvote 0
Aladin
Sorry but i think i missed you
let's assume that In "A1" houses the words: Teach Math Child
I need that each time i click.
the words will switch thier places.
click 1: Math Teach Child
click 2: Child Teach Child

Zvika
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top