[Solved] How do I SUM with this condition?

Help with installation and general system troubleshooting questions concerning the office suite LibreOffice.
Post Reply
Ziggletooth
Posts: 13
Joined: Sun Sep 14, 2014 11:40 pm

[Solved] How do I SUM with this condition?

Post by Ziggletooth »

Hello.

I have a list of values of which I want to find the average.
I am using this formula

=SUM(C$302:C313)/(A313-300)

The C column contains 1 or 0. However I want to update my spreadsheet so that it is possible for the C column to contain 2. I have modified my other columns to reflect this but not sure how to modify this formula that deals with a range.

Essentially I want the same formula except if there's a 2 I want it to be read as a 1, so basically summing the existence of a value that isn't 0 rather than the values themselves as it were.

Further clarity, right now I have 60% for values in the C column 1, 0, 1, 0, 1, but I want that to be true for the values 2, 0, 1, 0, 1 (still 60%) etc

Thank you.
Last edited by MrProgrammer on Thu May 12, 2022 3:36 am, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Open Office vr 4.1.2
Win7
FJCC
Moderator
Posts: 9283
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How do I SUM with this condition?

Post by FJCC »

Try

Code: Select all

SUMPRODUCT(C$302:C313 > 0)/(A313-300)
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Ziggletooth
Posts: 13
Joined: Sun Sep 14, 2014 11:40 pm

Re: How do I SUM with this condition?

Post by Ziggletooth »

Thank you very much
Open Office vr 4.1.2
Win7
Post Reply