Inverting a whole column

classic Classic list List threaded Threaded
5 messages Options
MR ZenWiz MR ZenWiz
Reply | Threaded
Open this post in threaded view
|

Inverting a whole column

I have spreadsheets from my financial institutions (for tax purposes).
Some of them do the deposits as positive and the debits as negative,
and others do the reverse.

Is there an easy way to multiply an entire column by -1 so I can make
them all fit a uniform convention?

What I've done before is convert the spreadsheets to .csv, use a shell
script to invert the chosen column and then convert back to .ods.
This is really clunky.

Thanks in advance.

Mark

--
To unsubscribe e-mail to: [hidden email]
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
Brian Barker Brian Barker
Reply | Threaded
Open this post in threaded view
|

Re: Inverting a whole column

At 16:11 29/06/2020 -0700, Mark Noname wrote:
>I have spreadsheets from my financial institutions (for tax
>purposes). Some of them do the deposits as positive and the debits
>as negative, and others do the reverse. Is there an easy way to
>multiply an entire column by -1 so I can make them all fit a uniform
>convention?

Of course.

Obvious way:
o Suppose your values are in column A, starting at row 2.
o In a new column, enter =-A2 in row 2.
o Fill down the new column.
o Cut or Copy the values in the new column.
o Paste back over column A, but using Edit | Paste Special... (or
Ctrl+Shift+V) instead of ordinary Paste.
o In the Paste Special dialogue, ensure that Formulas is *not* ticked.
o Delete the new column.

Clever way:
o Enter -1 in a spare cell somewhere.
o Copy that value.
o Select the range of values to be negated.
o Go to Edit | Paste Special... (or Ctrl+Shift+V).
o In the Paste Special dialogue, under Operations, select Multiply.

>What I've done before is convert the spreadsheets to .csv, use a
>shell script to invert the chosen column and then convert back to
>.ods. This is really clunky.

There are always unnecessarily complicated ways to solve any problem.

I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: [hidden email]
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

remygauthier remygauthier
Reply | Threaded
Open this post in threaded view
|

Re: Inverting a whole column

In reply to this post by MR ZenWiz
Hi,

If your goal is to only display the values according to a uniform
convention, you can define a cell numbering format that reverses the
display when compared to a "normal" display for the cells that contain
reverse-convention values. Something like this:

[<=0]# ##0;[>0]-# ##0;Standard

This will apply a "positve" format to a negative number, and a
"negative" format to a positive number, displaying "32" as "-32" and
vice-versa. Of course, this only changes the display. If you make any
calculations with these numbers, you will need to  adjust your formula
accordingly but that is something relatively easy to do if your column
heading or a cell contains the name of the financial institution that
provided the value.

I hope this helps.

Rémy.

Le lundi 29 juin 2020 à 16:11 -0700, MR ZenWiz a écrit :

> I have spreadsheets from my financial institutions (for tax purposes).
> Some of them do the deposits as positive and the debits as negative,
> and others do the reverse.
>
> Is there an easy way to multiply an entire column by -1 so I can make
> them all fit a uniform convention?
>
> What I've done before is convert the spreadsheets to .csv, use a shell
> script to invert the chosen column and then convert back to .ods.
> This is really clunky.
>
> Thanks in advance.
>
> Mark
>

--
To unsubscribe e-mail to: [hidden email]
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
John Kaufmann John Kaufmann
Reply | Threaded
Open this post in threaded view
|

Re: Inverting a whole column

In reply to this post by Brian Barker
On 2020-06-29 20:44, Brian Barker wrote:

> At 16:11 29/06/2020 -0700, Mark Noname wrote:
>> .... Some [financial institutions] do the deposits as positive and the debits as negative, and others do the reverse. Is there an easy way to multiply an entire column by -1 so I can make them all fit a uniform convention?
>
> Of course.
> ...
> Clever way:
> o Enter -1 in a spare cell somewhere.
> o Copy that value.
> o Select the range of values to be negated.
> o Go to Edit | Paste Special... (or Ctrl+Shift+V).
> o In the Paste Special dialogue, under Operations, select Multiply.

Cute. I never knew about that, and now wonder when those Operations started.

Between this and Rémy Gauthier's suggestion to overcome a formatting issue with clever formatting, reading this thread has been rewarded by elegance.

--
To unsubscribe e-mail to: [hidden email]
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
MR ZenWiz MR ZenWiz
Reply | Threaded
Open this post in threaded view
|

Re: Inverting a whole column

In reply to this post by MR ZenWiz
Many many thanks - the clever way works perfectly.

Mark

On Mon, Jun 29, 2020 at 5:44 PM Brian Barker <[hidden email]> wrote:

>
> At 16:11 29/06/2020 -0700, Mark Noname wrote:
> >I have spreadsheets from my financial institutions (for tax
> >purposes). Some of them do the deposits as positive and the debits
> >as negative, and others do the reverse. Is there an easy way to
> >multiply an entire column by -1 so I can make them all fit a uniform
> >convention?
>
> Of course.
>
> Obvious way:
> o Suppose your values are in column A, starting at row 2.
> o In a new column, enter =-A2 in row 2.
> o Fill down the new column.
> o Cut or Copy the values in the new column.
> o Paste back over column A, but using Edit | Paste Special... (or
> Ctrl+Shift+V) instead of ordinary Paste.
> o In the Paste Special dialogue, ensure that Formulas is *not* ticked.
> o Delete the new column.
>
> Clever way:
> o Enter -1 in a spare cell somewhere.
> o Copy that value.
> o Select the range of values to be negated.
> o Go to Edit | Paste Special... (or Ctrl+Shift+V).
> o In the Paste Special dialogue, under Operations, select Multiply.
>
> >What I've done before is convert the spreadsheets to .csv, use a
> >shell script to invert the chosen column and then convert back to
> >.ods. This is really clunky.
>
> There are always unnecessarily complicated ways to solve any problem.
>
> I trust this helps.
>
> Brian Barker
>

--
To unsubscribe e-mail to: [hidden email]
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