View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Joe User[_2_] Joe User[_2_] is offline
external usenet poster
 
Posts: 905
Default SUMIF question (although, I think I'm using the wrong function

"Gary''s Student" wrote:
=SUMPRODUCT(--(LEFT(A1:A5,4)="1743"),--(B1:B5))


The double negation before B1:B5 might be useful if you assume B1:B5
contains numeric strings (text). But in that case I would prefer the simpler
form:

=SUMPRODUCT((LEFT(A1:A5,4)="1743")*(B1:B5))

with or without the parentheses around B1:B5.

Otherwise, the double negation before B1:B5 seems superfluous, as are the
parentheses. More to the point, --B1:B5 defeats the purpose of writing
separate SUMPRODUCT arguments.

If B1:B5 is expected to contain numbers, I would prefer:

=SUMPRODUCT(--(LEFT(A1:A5,4)="1743"), B1:B5)

since that avoids a #VALUE if some of B1:B5 are purposely non-numeric and to
be ignored.


----- original message -----

"Gary''s Student" wrote:

=SUMPRODUCT(--(LEFT(A1:A5,4)="1743"),--(B1:B5))
--
Gary''s Student - gsnu200909


"Ashley" wrote:

I have a 2 column log that tracks incoming call amounts from agents
identified as 6 digit numbers CCOOAA - County, Office, Agent#:

171917 4
174327 6
171629 9
174327 13
172832 5

I want to add another table that takes ONLY the first 4 digits from the 6
digit number, then adds the totals from their call amounts. IN the example
above, for 174327, it would equal 19. (13+6).