[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libreoffice-users] sum text column of common unit of measure numbers


Hi,
If your values takes up, for instance the range A2 to A29, you can
enter this formula as an array formula:
=SUM(VALUE(SUBSTITUTE(SUBSTITUTE(A2:A29," KB","")," MB","")))
The only trick is to hit CTRL-SHIFT-ENTER instead of just ENTER at the
end of the formula entry: if you only use ENTER, this will be a
"normal" formula and it will not work. To make sure you did it right,
the formula should appear with curly braces on each side in the formula
display, like this:
{=SUM(VALUE(SUBSTITUTE(SUBSTITUTE(A2:A29," KB","")," MB","")))}
Another thing toi be careful about: if your decimal separator is the
comma (","), the dot in your list of numbers will also have to be
changed. You can change the formula like this to make the change of
separator:
=SUM(VALUE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2:A29," KB",""),"
MB",""),".",",")))
Now, if you really want to be fancy, you can use the REGEX function to
remove the units. This will remove KB, MB, and GB:
=SUM(VALUE(REGEX(A2:A29," [KMG]B","")))
And don't forget that CTRL-SHIFT !
I hope this helps.
Rémy.
Le jeudi 07 mai 2020 à 15:23 -0500, Wade Smart a écrit :
> Copy your data into a txt file. Open with yourspreadsheet, separate
> by space to put numbersin Col A and Kb/mb in Col b. Col c = A1*1000
> to gettotal kb. The sum up the whole thing. Divide the totalby 1000
> to get mb.-- Registered Linux User: #480675Registered Linux Machine:
> #408606Linux since June 2005
> On Thu, May 7, 2020 at 2:05 PM James <bjlockie@lockie.ca> wrote:
> > My cell phone provider only provides me a CSV with a text field for
> > theusage.I want to =sum( it so I need it to be numbers.Is a macro
> > the easiest way to make a new column of common unit ofmeasure (GB?)
> > numbers?
> > 15 KB5 KB10 KB15 KB5 KB5 KB5 KB1.8 MB5 KB5 KB15 KB215 KB130.2 MB9.2
> > MB475 KB11.7 MB10 MB15 KB12.1 MB5 KB10 KB7.1 MB5.3 MB4.9 MB15 KB240
> > KB130 MB2.9 MB
> >
> > --To unsubscribe e-mail to:
> > users+unsubscribe@global.libreoffice.org
> > Problems?
> > https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> > Posting guidelines + more:
> > https://wiki.documentfoundation.org/Netiquette
> > List archive: https://listarchives.libreoffice.org/global/users/
> > Privacy Policy: https://www.documentfoundation.org/privacy

--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.