Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a spreadsheet with @ 4000 cells containing a summation like (for example) =439+23+678+1 (Stock market data.) Each number in the formula could vary between 1 and 5 digits. I need to replace each cell with a summation of only the first two numbers.

A Find and Replace operation would be perfect, but wildcard characters don't work for numbers. I know there is probably some complicated VBA instruction that would work, but I'm VBA illiterate, so if anyone can help on that front, please don't assume any prior knowledge.

share|improve this question

1 Answer 1

When you say wildcards don't work for numbers, what do you mean? Do you have Use Wildcards selected? Does each cell have the same number of fields? If so, you should be able to search for this:

(=<*>+<*>)+<*>+<*>

If not, and there are no decimals, you could search for this:

(=[0-9]{1,}+[0-9]{1,})+<*>

In both cases, replace with \1

You might have to switch to Formula View first using Ctrl` (backtick) if you haven't already.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.