Dear Sir,
Thanks for your reply to my post.As already I have said that the credit column i.e F column amount can match also or may not also with respect to E column becoz in case of shortfall,next value of E column is also taken and corresponding date is also taken.From this days is taken out by the difference of Sales bill date & that payment date whose sales bill match.After this days is calculated inorder to check where this falls within discount criteria or not.If so further calculation is done.Here the Reference No.is unique as well as payment received either thru Bank or Cash is also unique.There is no duplication for it neither Bank row nor cash row reference no.will match to Sales(Debit column i.e E column).D column represent Reference no. for Debit & Credit.Regarding allocation,how you do it depends upon how you try to solve .As already you have seen manual calculation which is not possible in case of large data.I want just to automate.You can apply any sort of method to get the target result which has been done in working at Right hand side of 'Question' sheet.
The formula you suggested is not appropriate.
My ultimate aim is to calculate Total discount amount based on the criteria stated in next worksheet.
With Best Rgds,
Suresh
Bookmarks