## [Solved] IF DSUM SUMIF?

### [Solved] IF DSUM SUMIF?

I'm still very green when it comes to spreadsheets.

I have a spreadsheet where want to add the totals from column C only if you put in an X in columns D-G. I have tried searching, googling and experimentation to no avail. I have tried IF DSUM and SUMIF but I am missing something.

Any help is appreciated.
Last edited by MrProgrammer on Tue Mar 24, 2020 7:41 pm, edited 2 times in total.
Reason: Moved from Beginners forum to Calc; Tagged ✓ [Solved]
OpenOffice 4.1.1 with MacOS X
Leighrawlins

Posts: 1
Joined: Fri Mar 20, 2020 2:46 am

### Re: IF DSUM SUMIF?

Welcome to the Forums.
From your brief description, it sounds like you would be best using the SUMPRODUCT function, rather than SUMIF, since you have your controls over several columns.
The formula would look like
Code: Select all   Expand viewCollapse view
`=sumproduct(C2:C500;D2:G500="X")`

OpenOffice 4.1.7 and LibreOffice 6.3.3.2 on Windows 7 Pro & Ultimate
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.

RusselB
Moderator

Posts: 6062
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

### Re: IF DSUM SUMIF?

Hi, and welcome to the forum.

Leighrawlins wrote:I'm still very green when it comes to spreadsheets.
[Tutorial] Ten concepts that every Calc user should know

Leighrawlins wrote:I have a spreadsheet where want to add the totals from column C only if you put in an X in columns D-G.
All of D-G? Any of D-G? Either SUMPRODUCT or DSUM will handle both cases.
202003192151.ods
[Tutorial] The SUMPRODUCT function

RusselB wrote:=SUMPRODUCT(C2:C500;D2:G500="X")
#VALUE! error because the dimension of C2:C500 (499x1) does not match D2:G500 (499x4).

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).

MrProgrammer
Moderator

Posts: 3981
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA