Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 51
  • Last Modified:

Excel sum using If

Hi,

I have 2 colums

A       B
Y        £15.00
Y        £20.00
-         £ -
Y        £30.00

I want to Sum total of B only if A has Y in it

Please help

Thanks

R8VI
0
R8VI
Asked:
R8VI
1 Solution
 
Rob HensonIT & Database AssistantCommented:
Thats easy with SUMIF function:

=SUMIF(A1:A5,"Y",B1:B5)

This says look at range A1:A5 and where it finds "Y", include the relevant row from B1:B5.

if you find that you will need more than one criteria, there is also SUMIFS function which allows multiple criteria but would cover that separately if you so required.

Thanks
Rob H
0
 
Rob HensonIT & Database AssistantCommented:
In your sample above, the result of SUM(B1:B5) will be the same as the SUMIF because the row without the Y has zero anyway.

Thanks
Rob H
0
 
ProfessorJimJamCommented:
see attached file.
Book1.xlsb
0
 
SunBowCommented:
I agree, although I often cannot see so good...

=SUMIF(A1:A4,"Y",B1:B4)
or
=SUMPRODUCT(1*($A$2:$A$5="Y")*($B$2:$B$5))
0
 
Martin LissRetired ProgrammerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now