Help with conditions in formula

Strawberrydelight

New Member
Joined
Jun 26, 2019
Messages
9
Hi, i'm looking to find the sum of two columns (that are not next to each other) based on the conditions of a third column. I am trying to do a final report of finances based on cost centres (in the third column), and the amounts are in two columns, cash and bank.

I'm not sure how to attach an image without using a url, so if anyone needs to see what I mean, and can tell me how to attach an image - I can do that. Thanks in advance.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
images/documents/attachments can be referenced from a open reputable cloud server, many won't visit due to work access or the number of hoaxes, and any site that requires registration is basically out as well.

You can however post html tables if properly configured, check my signature line for links and info
 
Upvote 0
The formula looks like this:

=SUM(IF('Entry Sheet'!$E$19:$E$652='Entry Sheet'!U54,IF('Entry Sheet'!$K$19:$K$652>0,'Entry Sheet'!$K$19:$K$652),0),0)

and I want it to also add column 'P' as well as 'K'.
 
Upvote 0
A slightly different approach with the data to be summed in columns M and N and the criteria in O:

Code:
=SUM((M2:M11+N2:N11)*(--(O2:O11="Center2")))

This is an array formula -- enter with CTRL+Shift+Enter
 
Upvote 0
You can adapt my array formula with whatever columns you want inside the first set of parens.
 
Upvote 0
The first part of my forula is the condition - If everything in column E = the codes on U54, and if everything in column K is more than 0, then add up column K. I want it to include adding column P with the same conditions. I've just tried your code, but it hasn't worked. Just trying it again. I've replaced M and N with K and P, and 0 with E - taking it that's what I was supposed to do.
 
Upvote 0
confirm you are using CSE to finalise ?
 
Upvote 0
I didn't try to create your large file, but hopefully can can adapt this modified array formula:

Code:
=SUM((--(U2:U11="Center2"))*((K2:K11>0)*(K2:K11+P2:P11)))

You can probably get away without the double minus. I'm just used to being safe rather than sorry.

The "center" criteria is first as you had it, then the test if the K column is >0 and it's added to the P column. With this data, the sum is 2090.

KPU
10100Center1
20200Center2
30300Center2
-40400Center1
50500Center2
60600Center3
70700Center4
80800Center1
90900Center2
-101000Center2

<tbody>
</tbody>
 
Last edited:
Upvote 0
Mm, that hasn't worked either. If I could attach an image, it would probably be easier, but I don't have a URL for it. And I can't find a way of just attaching the image to show you.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,684
Members
448,977
Latest member
dbonilla0331

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top