how to lookup and add numbers

  • Thread starter Thread starter dlaery
  • Start date Start date
D

dlaery

I have a list of items with item numbers. The Item numbers are:
RB4116
RG4116
TB2116
TG4132
etc... etc...

first column
item number
second column
quantity

I want to lookup the first column to find a value "B4".
Every item number that has a "B4", I would like to add the numbers in
the second column.

Thanks!
David
 
Hi David,

Here's one way:

This assumes that the "B4" characters will always be the
2nd and 3rd characters in the string.

=SUM(IF(MID(A1:A4,2,2)="B4",B1:B4,""))

Entered as an array - CTRL+SHIFT+ENTER

You can also use a cell reference in place of the hard
coded "B4" for more versatility.

=SUM(IF(MID(A1:A4,2,2)=AA1,B1:B4,""))
 
Hey Thanks! That works great.

But, what if it is the 3 and 4 characters somtimes? "B4"

=SUM(IF(MID(D7:D51,2,2)=B54,F7:F49,""))

WPB4116
WPG4116
RB4116
RG4116
TB2116
TG4132

Davi
 
Back
Top