[Solved] Can only get % formula to work partway

Discuss the spreadsheet application
Locked
User avatar
Leiif010
Posts: 68
Joined: Sat Aug 05, 2023 4:24 am

[Solved] Can only get % formula to work partway

Post by Leiif010 »

I am trying to get a formula to calculate a % of 1s or -1s from active cells. I tried multiple ways and E3 and F3 have 2 different ways I tried. The formula works fine as long as row 4 is larger than 6 but I can not get it to work the other way. If 4 and 6 are even it should return 0, so Q3 should be 0 and it isn’t.

All I really need is the sum and the % rows but created the others to get the data for calculations. There are times when there is no number and I put an na in the cell so some of the total active cells are lower for some columns.
Attachments
testing by the hr.ods
(23.64 KiB) Downloaded 48 times
Last edited by Leiif010 on Tue Jan 06, 2026 4:50 am, edited 1 time in total.
OpenOffice 4.1.14 on Windows 7
User avatar
Leiif010
Posts: 68
Joined: Sat Aug 05, 2023 4:24 am

Re: Can only get % formula to work partway

Post by Leiif010 »

I got solutions as follows:
mariosv

Formula in M3:
=IF(M4>M6;(M4/M2);(IF(M6>M4);(M6/M2);0))
should be:
=IF(M4>M6;(M4/M2);IF(M6>M4;(M6/M2);0))
In IF(M6>M4), the close parenthesis is closing the IF.
Remember that function wizard can help to find these issues.

karolus

Hallo

=IF(M4=M6 ; 0 ; MAX(M4;M6) / M2 )

Thanks to both mariosv and karolus, both solutions work
OpenOffice 4.1.14 on Windows 7
User avatar
karolus
Volunteer
Posts: 1243
Joined: Sat Jul 02, 2011 9:47 am

Re: [Solved] Can only get % formula to work partway

Post by karolus »

Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Locked