ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If Statment using Criteria (https://www.excelbanter.com/excel-discussion-misc-queries/25751-if-statment-using-criteria.html)

Brent E

If Statment using Criteria
 
Good afternoon,

I am trying to assist somebody at work. I would like to ask if there is a
way to set a formula in a totals cell at the bottom or a spreadsheet (for
example) where for every cell in
Column A that contains a certain ID, their corresponding values in column B
are summed. For instance if A2 A3 AND A11 contain a specific ID, then a
'totals' cell would add B2, B3 AND B11. I would like to use an IF statement
or something for example: (SUM B cells where A cells=ID). What syntax would I
use for this? Thanks.

Cordially,


Dominic

Brent,

The easiest way to accomplish this would be to use the "SumIf" function. If
you have your IDs in cells A1 thru A7 and your data in cells B1 thru B7 then:

SumIf(A1:A7, "ID#", B1:B7)

Hope that helps.

"Brent E" wrote:

Good afternoon,

I am trying to assist somebody at work. I would like to ask if there is a
way to set a formula in a totals cell at the bottom or a spreadsheet (for
example) where for every cell in
Column A that contains a certain ID, their corresponding values in column B
are summed. For instance if A2 A3 AND A11 contain a specific ID, then a
'totals' cell would add B2, B3 AND B11. I would like to use an IF statement
or something for example: (SUM B cells where A cells=ID). What syntax would I
use for this? Thanks.

Cordially,


Brent E

Magnificent. Thanks.

"Dominic" wrote:

Brent,

The easiest way to accomplish this would be to use the "SumIf" function. If
you have your IDs in cells A1 thru A7 and your data in cells B1 thru B7 then:

SumIf(A1:A7, "ID#", B1:B7)

Hope that helps.

"Brent E" wrote:

Good afternoon,

I am trying to assist somebody at work. I would like to ask if there is a
way to set a formula in a totals cell at the bottom or a spreadsheet (for
example) where for every cell in
Column A that contains a certain ID, their corresponding values in column B
are summed. For instance if A2 A3 AND A11 contain a specific ID, then a
'totals' cell would add B2, B3 AND B11. I would like to use an IF statement
or something for example: (SUM B cells where A cells=ID). What syntax would I
use for this? Thanks.

Cordially,


Ragdyer

You can carry this a step further by assigning a cell to hold the ID number.
That way, you can simply key in various ID numbers to return their
corresponding totals.

=SUMIF(A1:A7,C1,B1:B7)

Where you can enter the ID number in C1, and not have to change the formula
itself to return the totals for a different ID.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Brent E" wrote in message
...
Magnificent. Thanks.

"Dominic" wrote:

Brent,

The easiest way to accomplish this would be to use the "SumIf" function.

If
you have your IDs in cells A1 thru A7 and your data in cells B1 thru B7

then:

SumIf(A1:A7, "ID#", B1:B7)

Hope that helps.

"Brent E" wrote:

Good afternoon,

I am trying to assist somebody at work. I would like to ask if there

is a
way to set a formula in a totals cell at the bottom or a spreadsheet

(for
example) where for every cell in
Column A that contains a certain ID, their corresponding values in

column B
are summed. For instance if A2 A3 AND A11 contain a specific ID, then

a
'totals' cell would add B2, B3 AND B11. I would like to use an IF

statement
or something for example: (SUM B cells where A cells=ID). What syntax

would I
use for this? Thanks.

Cordially,




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

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