View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default Using VLOOKUP and "AND" together

Put the date of interest in, say, i2, and this formula in J2:

=SUMPRODUCT((A$1:A$1000=i$2)*(C$1:C$1000="MR1")*(G $1:G$1000))

to give you a sum of the MR1 entries for that date. I've assumed that
you have 1000 rows of data, but adjust this if you have more. You can
copy the formula down and just change the "MR1" bit as appropriate for
the other Line values, or you could put the line values in H2 to H7,
say, and change the formula to this:

=SUMPRODUCT((A$1:A$1000=i$2)*(C$1:C$1000=H2)*(G$1: G$1000))

and then copy down.

Hope this helps.

Pete

On May 16, 7:42*pm, chocoman
wrote:
I have a worksheet that looks like this:

A * * * * * * * * * * * B * * * *C * * * *D * * * E * * * F * * *G * *
..............................
Date * * * * * * * * --- * * *Line * *--- * * *--- * * --- * * Value

01-Jan-08 * * * * ---- * * MR1 * * * * * * * * * * * * * * * 200
01-Jan-08 * * * * ---- * * MR1 * * * * * * * * * * * * * * * 100
01-Jan-08 * * * * ---- * * MR2 * * * * * * * * * * * * * * * *50
01-Jan-08 * * * * ---- * * MR2 * * * * * * * * * * * * * * * *75
01-Jan-08 * * * * ---- * * MR2 * * * * * * * * * * * * * * * 125

This is a very large database with four different (C column) types per date
and each type may have 1-6 entries. I want to be able to lookup the date and
sum the values for each C column type.

Can anyone help please?

N.B. The columns which are blank have info, however I don't need that info
right now.
*Mike