Question

I have a data set that looks like this:

$40/5y 6m
$25/12y
$57/5y
$25/10y
$44/3y, $45.32/3y, $46.68/3y, $48.08/3y, $49.52/3y
$67/5y, $72/5y
$28/5y

I need to multiply the dollar amounts by their respective year and sum them if there is more than one. For example the first row would need to be 40*5.5 and the second to last row would need to be (67*5) + (72*5). I tried text to columns and a bunch of find and replace, but it was such a messy solution and didn't really work as planned. So, should I learn how to do macros or is this something that can be done with simple formulas?

Was it helpful?

Solution

See if this works:

1) Copy everything into Microsoft Word
2) Open "find and replace" and do the following replacements ("use wildcard characters" should be unchecked):
- replace (one space) with nothing
Then these have no spaces:
- replace $ with ^t
- replace / with ^t
- replace y, (with the comma) with ^t^t
- replace y with ^t
- replace m with nothing

Now paste this back in an Excel spreadsheet. You should have your data separated in cells like this: (empty), dollars, years, months, (empty), dollars, years, months, (empty), dollars, years, months...

So then you could just make a partial calculation every 3 cells =dollars*(years+(months/12)) and then sum these partials into one total.

Would this help?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top