[Solved] Want to use something like SUMIF

Discuss the spreadsheet application
Post Reply
swampwiz
Posts: 40
Joined: Wed Mar 17, 2010 11:30 am

[Solved] Want to use something like SUMIF

Post by swampwiz »

I have a Calc spreadsheet where there are values in columns A & B. I want to the SUMIF to check for a condition in row A, and if the condition is TRUE, then add in the value in the cell in corresponding row B, but not if FALSE.

So the function here would be like a SUM except that it would only add the values in the upper table if the A value there is <= the A value to the left of the function. I don't think that SUMIF does it like this.

•  A      B 

   00     234  
   07     188   
   14     069 

   00     234
   05     234
   10     422
Last edited by Hagar Delest on Fri Jul 26, 2024 7:40 am, edited 3 times in total.
Reason: tagged solved.
Windows XP Professional, Version 5.1, Service Pack 3
OpenOffice 4.1.2
(perhaps later versions since these are really old and obsolete -- MrProgrammer, forum moderator)
User avatar
karolus
Volunteer
Posts: 1245
Joined: Sat Jul 02, 2011 9:47 am

Re: Want to use something like SUMIF

Post by karolus »

swampwiz wrote: Thu Jul 25, 2024 4:55 pm I have a Calc spreadsheet where there are values in rows A & B. I want to the SUMIF to check for a condition in row A, and if the condition is TRUE, then add in the value in the cell in corresponding row B, but not if FALSE.
most people name it »Column« but you »Row« … maybe you should switch your mindset?

swampwiz wrote: Thu Jul 25, 2024 4:55 pm So the function here would be like a SUM except that it would only add the values in the upper table if the A value there is <= the A value to the left of the function. I don't think that SUMIF does it like this.

•  A      B 

   00     234  
   07     188   
   14     069 

   00     234
   05     234
   10     422

Code: Select all

=SUMIF(A$1:A$3;"<="&A10;B$1:B$3)
Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
swampwiz
Posts: 40
Joined: Wed Mar 17, 2010 11:30 am

Re: Want to use something like SUMIF

Post by swampwiz »

Yes, that was a brain fart on that sentence. I have updated it.

And this is a solution that works perfectly! :bravo:
Windows XP Professional, Version 5.1, Service Pack 3
OpenOffice 4.1.2
(perhaps later versions since these are really old and obsolete -- MrProgrammer, forum moderator)
Post Reply