[Solved] Sum values for a transaction category

Discuss the spreadsheet application
Post Reply
WallyWest
Posts: 1
Joined: Mon Jan 15, 2024 2:29 am

[Solved] Sum values for a transaction category

Post by WallyWest »

I'm sure this is very basic, but I'm new to doing anything useful with a database.

I have a sheet in my budgeting database with a list of transactions. What I want to do on the main sheet is have a cell that takes every row from the transaction sheet where column C = *whatever*, and then from the results of that sum everything in column D. That's probably quite easy, but yeah, I'm not sure of any part of that except for using the Sum function.

If the answer is just pointing me towards the various functions I need to research that's cool, I'm just not sure where to start.

Thanks.
 Edit: Changed subject, was Beginner function writing question 
Make your post understandable by others 
-- MrProgrammer, forum moderator 
Last edited by MrProgrammer on Fri Jan 26, 2024 10:58 pm, edited 2 times in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Open Office 4.1.14
Windows 10 64bit
User avatar
robleyd
Moderator
Posts: 5087
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Beginner function writing question

Post by robleyd »

I'm new to doing anything useful with a database.
I think you are in fact dealing with a spreadsheet. If you want to sum everything in a column where a certain value appears the same row in another column, the function you most likely want is SUMIF(). SUMPRODUCT() can do as SUMIF does, but with more power - see [Tutorial] The SUMPRODUCT function

On the other hand, if you are looking to get the separate sums of all the various "somethings" in your transaction listing, you should look to a Pivot Table formerly known as Data Pilot.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
FJCC
Moderator
Posts: 9284
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Beginner function writing question

Post by FJCC »

You can use the SUMIF() function. Something like

Code: Select all

=SUMIF(C2:C200;"Rent";D2:D200)
For more flexibility, put the the term you want to search for in some cell, say F1

Code: Select all

=SUMIF(C2:C200;F1;D2:D200)
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.
Post Reply