Hi Praveen, Siti's formulae for column D and E are fine and should be applied first. But then I suggest to run this macro, because the SUMPRODUCT is not working for me...
Feedback please. Kind regards, Paul Willekens '======================================================================= Sub InvoicePrice() Dim cTown Dim dDatum Dim nMax Dim nPos Dim nRow nMax = 121 nRow = 2 While Len(Cells(nRow, 6).Value) > 0 dDatum = Cells(nRow, 6).Value cTown = Cells(nRow, 7).Value For nPos = 5 To nMax If Cells(nPos, 1) = cTown Then If dDatum >= Cells(nPos, 4) And dDatum <= Cells(nPos, 5) Then Cells(nRow, 8).Value = Cells(nPos, 3).Value Exit For End If End If Next nRow = nRow + 1 Wend MsgBox "Done at row " & (nRow - 1) End Sub '======================================================================= -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,800 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe To unsubscribe, reply using "remove me" as the subject.