View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default Summing a range of cells with criteria

What matters is not whether they are FORMATTED as numbers, because that
affects only the display, but whether the contents ARE numbers.
Check with the formulae =ISNUMBER(Y2), =ISTEXT(Y2), and similarly
=ISNUMBER(R2), and =ISTEXT(R2)
Similarly try =Y2=1 to see whether that returns true or false.
--
David Biddulph

"Fredrated" wrote in message
...
That's a good guess.
However, Formatcells says they are formatted as numbrs.

But in case, I tried =SUMIF(Y2:Y340,"1",R2:R340), but still no luck.

Fred

"Glenn" wrote:

Make sure that the 0 or 1 in column Y is actually a number and not text
that
looks like a number.


Fredrated wrote:
Sounds good, but for reasons I don't understand it doesn't seem to
work.

I used (in cell Y350)
=SUMIF(Y2:Y340,Y341,R2:R340) (Y341 = 1) and also tried
=SUMIF(Y2:Y340,1,R2:R340)
R2 to R340 contains acres of land, so all values are greater than or
equal
to 0.
Column Y contains 0 or 1 depending on characteristics of the land in
column R.
Many rows have a 1 in Y and acres in R

But the function only returns 0 in the formula cell.

????????

Fred


"Glenn" wrote:

Fredrated wrote:
I am trying to use dsum(range,field,criteria) to sum values in 1
column when
another column equals 1, but I cannot understand from the help how
the
criteria is determined from a range of cells.

from help: "Field indicates which column is used in the function"
But several columns are used in the function, so what does this mean?

One attempt:
=DSUM(R2:R340,25,Y1:Y341)
This is an attempt to add the values in column R rows 2 to 340 when
column
Y(i.e., 25) for a given row is equal to 1. I placed a 1 into cell
Y341.

Also tried, doesn't work:
=DSUM(R2:R340,18,Y1:Y341)
where 18 is column R, 'used in the function'.

However, this doesn't work, and I can't figure out from the help
examples
exactly what the 'field' is or how criteria is to be expressed as a
range of
cells.

Any help is appreciated, thanks.

Fred

Try this:

http://www.contextures.on.ca/xlFunctions01.html#SumIf