View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.newusers
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Excel - find where a number falls in a start and end range

On Tue, 21 Oct 2008 05:58:01 -0700, Mkuria wrote:

Thanks Ron, this works for the number but it does not take into account the
date and name columns.
--
mmk


Ah, yes.

In my first hasty look at your problem, it seemed irrelevant. But I see it is
not.

This should work. It assumes that a data line from table B will only find a
match in a single line of Table A.

name, date, Start, End, Price and Qty are named columns in Table A.

This will return a zero if there is no match

=SUMPRODUCT((name=A15)*(date=B15)*(Start<=C15)*(En d=C15)*Price)

The data from Table B is in A15:C23

If you have Excel 2007, you could use:

=SUMIFS(Price,name,A15,date,B15,Start,"<="&C15,End ,"="&C15)

To obtain the Quantity, merely substitute Qty for Price in either of the above
formulas.
--ron