Thread: Excel formula
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JE McGimpsey
 
Posts: n/a
Default Excel formula

One way:

B2: =IF(A2=Schools!A2,Schools!B2,"")

copy down to B2000.

OTOH, if you want to sum all the Schools!B2:B2000 where
A2:A2000=Schools!A2:A2000 in one cell:

=SUMPRODUCT(--(A2:A2000='Schools'!A2:A2000), Schools!B2:B2000)

or, if you want to exclude blanks:

=SUMPRODUCT(--(A2:A2000=Schools!A2:A2000), --(A2:A2000<""),
Schools!B2:B2000)


For an explanation of --, see

http://www.mcgimpsey.com/excel/doubleneg.html
In article . com,
wrote:

I need to create a formula that will compare the contents of cells
A2:A2000, to the contents of cells A2:A2000 in another worksheet
('schools'), and when finding 2 values that match, I need to bring the
contents of the corresponding cell in column B from 'schools' into the
first worksheet.

How do I go about setting this up?

KLR