View Single Post
  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
Sune Fibaek[_2_] Sune Fibaek[_2_] is offline
external usenet poster
 
Posts: 2
Default Lookup using two values - like an SQL in the same workbook

Hall wrote:
I have a table of data. Elsewhere in the workbook, I want to include a
formula to count all the rows in that table that have a value of "A" in the
first column and a "B" in the second column. Kind of like


With the As in A1:A10 and the Bs in B1:B10 use this formula:
=SUMPRODUCT((A1:A10="a")*(B1:B10="b"))

You can also use =SUM((A1:A10="a")*(B1:B10="b")) as a matrixformula (end
it with ctrl+shift+enter) if you like.

/Sune