ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sums according to the content of fields (https://www.excelbanter.com/excel-worksheet-functions/34458-sums-according-content-fields.html)

James1976

Sums according to the content of fields
 
Hello everyone,

I would like to sum figures in a table according to the contents of the
fields. For example I have three definitions in column A : First, Second,
Third and a number in column B. I would like to generate a sum for all the
numbers where column B = "First" and then another sum where column B = Second
or Third.

Thanks very much for any help you can give me.
--
James

bj

Try
=sumif(A:A,"First",B:B)
etc.

"James1976" wrote:

Hello everyone,

I would like to sum figures in a table according to the contents of the
fields. For example I have three definitions in column A : First, Second,
Third and a number in column B. I would like to generate a sum for all the
numbers where column B = "First" and then another sum where column B = Second
or Third.

Thanks very much for any help you can give me.
--
James


James1976

Hello,

Thanks for your reply but I tried sum if and before and it returns just a 0.
--
James


"bj" wrote:

Try
=sumif(A:A,"First",B:B)
etc.

"James1976" wrote:

Hello everyone,

I would like to sum figures in a table according to the contents of the
fields. For example I have three definitions in column A : First, Second,
Third and a number in column B. I would like to generate a sum for all the
numbers where column B = "First" and then another sum where column B = Second
or Third.

Thanks very much for any help you can give me.
--
James


bj

if your answer is zero one of two things
the Column A does not match or the the column B are not numbers

to check column A
try
for one of the cells which says "First" (A3??)
in a blank cell enter
=A3="First"
if the answer is false there are probably spaces or something
try
=Trim(A3)="First"

To check Column B
=sum(B10:B12) or appropriate range
if the answer is 0 then column B is probably text which looks like numbers
Try entering 1 in an empty cell copying the cell
Select the data in column B and paste special mulitply
check your sum b10:b12 cell If still 0
use a helper column and enter
=value(trim(B1))
and copy down to the bottom of your data. copy and paste special values over
B

"James1976" wrote:

Hello,

Thanks for your reply but I tried sum if and before and it returns just a 0.
--
James


"bj" wrote:

Try
=sumif(A:A,"First",B:B)
etc.

"James1976" wrote:

Hello everyone,

I would like to sum figures in a table according to the contents of the
fields. For example I have three definitions in column A : First, Second,
Third and a number in column B. I would like to generate a sum for all the
numbers where column B = "First" and then another sum where column B = Second
or Third.

Thanks very much for any help you can give me.
--
James



All times are GMT +1. The time now is 07:47 AM.

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