dbmathis
Well-known Member
- Joined
- Sep 22, 2002
- Messages
- 1,064
I hope there is someone out there that can help me on this. This is a last ditch effort.
I have a column of blank cells m11 throught m22. Each cell possibly holds a value of a check that has been written but has not cleared.
One cell on my sheet contains a difference of my previous bank balance and my new bank balance after an unknown number of checks have cleared.
Say for Example
-----
My bank balance was $500.00 dollars on 9/22/2002
Checks that have not cleared =
m11 = $5.00
m15 = $15.00
m16 = $35.00
m20 = $6.00
-----
My account balance is now $489 dollars on 9/28/2002
$11.00 dollars is the difference.
It's obvious that checks $6.00 and 5.00 are the checks that have cleared!
What I am trying to do is find out a simple way to sum every number that is listed in m11:m22 in every sum combination possible.
Then display the combonation of numbers that = the difference when summed together
I know the long way to do this...
In one cell put
if(m11=sum(m11:m22),m11,"")
if(m11+m12=sum(m11:m22),m11,"")
if(m11+m13=sum(m11:m22),m11,"")
etc....
Then the next cell put
if(m11=sum(m11:m22),m12,"")
if(m11+m12=sum(m11:m22),m12,"")
if(m11+m13=sum(m11:m22),m12,"")
and so on....
But this would require an excessive amount of IF statments and named formulas.
Is there a simple VBA script to get around this?
Thankz in advance for any help.
David Mathis.
I have a column of blank cells m11 throught m22. Each cell possibly holds a value of a check that has been written but has not cleared.
One cell on my sheet contains a difference of my previous bank balance and my new bank balance after an unknown number of checks have cleared.
Say for Example
-----
My bank balance was $500.00 dollars on 9/22/2002
Checks that have not cleared =
m11 = $5.00
m15 = $15.00
m16 = $35.00
m20 = $6.00
-----
My account balance is now $489 dollars on 9/28/2002
$11.00 dollars is the difference.
It's obvious that checks $6.00 and 5.00 are the checks that have cleared!
What I am trying to do is find out a simple way to sum every number that is listed in m11:m22 in every sum combination possible.
Then display the combonation of numbers that = the difference when summed together
I know the long way to do this...
In one cell put
if(m11=sum(m11:m22),m11,"")
if(m11+m12=sum(m11:m22),m11,"")
if(m11+m13=sum(m11:m22),m11,"")
etc....
Then the next cell put
if(m11=sum(m11:m22),m12,"")
if(m11+m12=sum(m11:m22),m12,"")
if(m11+m13=sum(m11:m22),m12,"")
and so on....
But this would require an excessive amount of IF statments and named formulas.
Is there a simple VBA script to get around this?
Thankz in advance for any help.
David Mathis.