Word keeps wrapping long formula onto multiple lines

I have pasted a formula in from Excel into Word as I need to document it. Instead of one long formula, Word has broken it into 4 lines at roughly half way across the page. I have checked hidden returns etc, I have pasted into Notepad - no joy. I have pasted in just text - no formatting at all. I have tried applying a new style and then going back - No joy at all. I have tried CTRL space and CTRL Q techniques - no joy. Thanks in advance.
sample.docx
vipamanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ejgil HedegaardCommented:
If a 'word' is too long to be on the remaining part of the line, Word moves it to the next line.
A 'word' is something without a space.
It looks like this
=IF(AND(E37="Yes",E39="Town"),"Ce(z) x Ce,t x ([(Co(z)
+0.6)/1.6)]^2)qb",IF(AND(E37="No",E39="Town"),"Ce(z) x Ce,t x
qb",IF(AND(E37="No",OR(E39="Sea",E39="Country")),"Ce(z) x qb","Ce(z) x ([(Co(z) +
0.6)/1.6)]^2)qb")))

Insert a space at appropriate place and Word will move the part before the space to the previous line.
Then it could be like this
=IF(AND(E37="Yes",E39="Town"),"Ce(z) x Ce,t x ([(Co(z) +0.6)/1.6)]^2)qb",IF(AND(E37="No"
,E39="Town"),"Ce(z) x Ce,t x qb",IF(AND(E37="No",OR(E39="Sea",E39="Country")),"Ce(z) x
qb","Ce(z) x ([(Co(z) + 0.6)/1.6)]^2)qb")))

It is a bit of try and error to make it look like you want it.

Or remove all spaces, and Word will fill the line before break, like this
=IF(AND(E37="Yes",E39="Town"),"Ce(z)xCe,tx([(Co(z)+0.6)/1.6)]^2)qb",IF(AND(E37="No",E39="Town
"),"Ce(z)xCe,txqb",IF(AND(E37="No",OR(E39="Sea",E39="Country")),"Ce(z)xqb","Ce(z)x([(Co(z)+0.6)/
1.6)]^2)qb")))
In Excel you can use something like =SUBSTITUTE(A1," ",""),  (Copy, Paste special, Values) to do it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vipamanAuthor Commented:
Thank you once again. I used find and replace in Word. Not perfect, but at least the code looks right (minus a few spaces!)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.