# reconciliation

in one column of the excel i have amounts received from various customers and in the next column i have break up of the amount, which have to match with total, how can I reconcile between two.. here is an example

In column A I have 1648

in Column B I have other amounts what it have to do is it have highlight all the amounts which can make it up total in the column A

200
300
400
60
28
8
40
500
200
430
125
example-rec.xlsx
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IT Services ConsultantCommented:
Hi,

Will the values listed always reach the total in some combination, or are you just looking for the "closest" without exceeding the expected total?
Microsoft Excel ExpertCommented:
@Uday,

there are different ways to accomplish what you are looking for.

B) there is a cheap commerial add-in that does this automatically, if you are doing this kind of calculation alot then add-in will be handy. trial also works for a limited time period

C)  Array formula.   i need to write this formula for you if you really do not want the previous options mentioned A and B.

learnerAuthor Commented:
yes please could you please provide me an array formula as i will not have administrative right for any addins or third party tools

@ fanpages : yes it might not be a exact match, it could be a "closet" to the total
Microsoft Excel ExpertCommented:
@Uday,

here is the solution with array formula.

formula =INT(MOD(MOD(SMALL(ABS(ROUND((MMULT(INT(MOD(ROW(B1:INDEX(B:B,2^ROWS(C3:C20)))/2^TRANSPOSE((B3:B20-1)),2)),C3:C20)-A21)*10^9,-7))+ROW(B1:INDEX(B:B,2^ROWS(C3:C20))),{1}),10^7)/2^(B3:B20-1),2)) is used in helper column for highlighting the values via conditional formatting
EE.xlsx

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Excel & VBA ExpertCommented:
@ProfessorJimJam

+1 for your attempt to this. :)
learnerAuthor Commented:
Brilliant.Thanks a ton!!!
learnerAuthor Commented:
@ProfessorJimJam: if i have amounts in some 500 rows in column c , do i have to just change C3:C20 to C3:C500?
Microsoft Excel ExpertCommented:
@Uday

you are most welcome. i was glad i could help.

I do not think it will work for a large data set.  because of limitation of multiple combination and because it will take too much time to recalculate and also the formula was designed for a small data set.  if you require solution for multiple combination with large data set. then i propose macro solution.
learnerAuthor Commented:
thank you. what would be a macro solution? I have found one in the below link but it is taking ages i have about hundred cells to match

http://www.tushar-mehta.com/excel/templates/match_values/
IT Services ConsultantCommented:
I wrote something in a question way back in 2003, that may be able to be re-used with your requirements:

[ http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_20769947.html ]

I updated the thread in 2005, attaching the workbook (as the link to the workbook previously provided was no longer available):

[ http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_20769947.html#a14376241 ]
Microsoft Excel ExpertCommented:
@uday

like Tushar's macro there are many other macros in the net, Harlan Grove also wrote macro called findsums . but all of them will fail with combination of 500 cells. Excel cannot tolerate the burden of 500 cells becuase if the amounts are in small numbers, there could be thousands of different multiple solutions.

based on my experience, no single macro can deal with 500 cells.  however there are many commerial softwares that use different algorithms to solve these and one of them is https://www.summatch.com/ add-in and its video exhibition on how it works.

in your case, i believe that Excel solver would be much better appreach. it is already a built-in Add-in in your machine.  you do not need to install anything, all you have to do is to activate it and then how to use it, refer to my first comment.
learnerAuthor Commented:
Thank you very much. I am able to add the solver addin it takes a lot of time. thank you very very much for all your suggestions.
learnerAuthor Commented:
@ProfessorJimJam: sorry closed post, However , from the formula that you have provided

here is the solution with array formula.

formula =INT(MOD(MOD(SMALL(ABS(ROUND((MMULT(INT(MOD(ROW(B1:INDEX(B:B,2^ROWS(C3:C20)))/2^TRANSPOSE((B3:B20-1)),2)),C3:C20)-A21)*10^9,-7))+ROW(B1:INDEX(B:B,2^ROWS(C3:C20))),{1}),10^7)/2^(B3:B20-1),2)) is used in helper column for highlighting the values via conditional formatting

can we extend this to 80 rows?
Microsoft Excel ExpertCommented:
Uday

it can go up to 25 rows not more than that it can go up if your excel version is 64bit but that would only add another 5 more rows.
learnerAuthor Commented:
ok thank you ProfessorJimJam. No worries i will check if there are any macros available, or can you suggest if there are any. thanks a lot again!!!
Microsoft Excel ExpertCommented: