ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Help with adding certain cells using an IF function (https://www.excelbanter.com/excel-worksheet-functions/34573-help-adding-certain-cells-using-if-function.html)

Jrr6415sun

Help with adding certain cells using an IF function
 

Is there a way in excel to go through each row and add a certain cell if
it meets a certain condition in an adjacent cell?

for example

Item Quantity Price

Pin 5 20
Tag 8 40
Pin 3 15
Tag 2 10
Tag 1 7

I want to add up all the prices if the item is a pin


--
Jrr6415sun
------------------------------------------------------------------------
Jrr6415sun's Profile: http://www.excelforum.com/member.php...o&userid=25064
View this thread: http://www.excelforum.com/showthread...hreadid=385838


RagDyeR

Try this:

=SUMIF(A:A,"Pin",C:C)

OR

Enter the item to lookup in another cell (D1), for easy revision:

=SUMIF(A:A,D1,C:C)

--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"Jrr6415sun" wrote
in message ...

Is there a way in excel to go through each row and add a certain cell if
it meets a certain condition in an adjacent cell?

for example

Item Quantity Price

Pin 5 20
Tag 8 40
Pin 3 15
Tag 2 10
Tag 1 7

I want to add up all the prices if the item is a pin


--
Jrr6415sun
------------------------------------------------------------------------
Jrr6415sun's Profile:
http://www.excelforum.com/member.php...o&userid=25064
View this thread: http://www.excelforum.com/showthread...hreadid=385838



Jrr6415sun


thank you very much

what if i want 2 criteria like in one column it has to be a pin and in
the other column it has to be the right date. Is there a way to do
this?


--
Jrr6415sun
------------------------------------------------------------------------
Jrr6415sun's Profile: http://www.excelforum.com/member.php...o&userid=25064
View this thread: http://www.excelforum.com/showthread...hreadid=385838


RagDyer

Enter the item in D1, and the date to match in D2, with the date containing
column as B:

=SUMPRODUCT((A1:A100=D1)*(B1:B100=D2)*C1:C100)

With this formula, you can't use total column references (A:A, B:B ...etc.).

--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"Jrr6415sun" wrote
in message ...

thank you very much

what if i want 2 criteria like in one column it has to be a pin and in
the other column it has to be the right date. Is there a way to do
this?


--
Jrr6415sun
------------------------------------------------------------------------
Jrr6415sun's Profile:

http://www.excelforum.com/member.php...o&userid=25064
View this thread: http://www.excelforum.com/showthread...hreadid=385838



Padgett


The formulas given do work but you have a second option...

Choose...Tools, Addins and turn on your conditional sum wizard...Then
from the Tools menu choose 'conditional sum' and add whatever
conditions you want to the grid as shown in the graphic i
uploaded...last steps just ask you where you want your answer/s to
land...choose however many cells you need to catch the final result.
Luck to you
NMP


+-------------------------------------------------------------------+
|Filename: CSumWizard Example.JPG |
|Download: http://www.excelforum.com/attachment.php?postid=3586 |
+-------------------------------------------------------------------+

--
Padgett

Master Certified Office Applications Instructor
------------------------------------------------------------------------
Padgett's Profile: http://www.excelforum.com/member.php...fo&userid=5670
View this thread: http://www.excelforum.com/showthread...hreadid=385838



All times are GMT +1. The time now is 12:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com