Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Excel sum using If

Posted on 2015-02-04
Medium Priority
49 Views
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

Thanks

R8VI
0
Question by:R8VI
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 33

Accepted Solution

Rob Henson earned 2000 total points
ID: 40588294
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

LVL 33

Expert Comment

ID: 40588299
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

LVL 26

Expert Comment

ID: 40588315
see attached file.
Book1.xlsb
0

LVL 24

Expert Comment

ID: 40588513
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

LVL 49

Expert Comment

ID: 40641556
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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
New style of hardware planning for Microsoft Exchange server.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
###### Suggested Courses
Course of the Month9 days, 10 hours left to enroll