PDA

View Full Version : SUMIF question



MrFoxar
07-08-2007, 02:52 PM
Hi there,

Just trying to figure out how to get SUMIF to look at only part of string of text in criteria.

example:

I have several transaction ID's in a range of cells, each type indicated by a prefix. Like, DNHT724672, DNHT239904, WYER8345.

Is there a way I can get SUMIF to only look at a portion of the cell, in this case the first four characters?

I just can't wrap my brain around what the syntax would be, even if it is possible. :banghead:

Thanks

Bob Phillips
07-08-2007, 03:37 PM
=SUMIF(A:A,"DNHT*",B:B)

TheAntiGates
07-08-2007, 03:38 PM
Welcome to the forum. Is adding another column permissible? You could add another column that is left(a1,4), and work off that column.

Since this is a VBA forum, you can go that way by essentially the same route, but this is simpler.

TheAntiGates
07-08-2007, 03:40 PM
or what xld said, even better.

MrFoxar
07-08-2007, 04:21 PM
Thanks a bunch. It figures it would be that simple. I never thought to use a wildcard. :dunno