Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
atmbonda
 
Posts: n/a
Default find all employees whose total salaries equal a given amount

Hello,

I have a large data file in 2 columns:
1st column = Employee ID
2nd Column = Salary

I want to find combinations of salaries whose total equals a certain amount
and identify those employees. Please any suggestions on how should I proceed?
What formula to use?

Thanks for your assistance.

al

  #2   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default find all employees whose total salaries equal a given amount

You need the solver add-in for this

"put the data set in let's say A2:A8, in B2:B8 put a set of ones {1,1,1 etc}
in the adjacent cells
in C2 put 8, in D2 put

=SUMPRODUCT(A2:A7,B2:B7)


select D2 and do toolssolver, set target cell $D$2 (should come up
automatically if selected)


Equal to a Value of 8, by changing cells $B$2:$B$7, click add under Subject
to the constraints of:
in Cell reference put


$B$2:$B$7


from dropdown select Bin, click OK and click Solve, Keep solver solution
and look at the table


2 1
4 0
5 0
6 1
9 0
13 0


there you can see that 4 ones have been replaced by zeros and the adjacent
cells to the 2 ones total 8 "



adapt to fit


--


Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"atmbonda" wrote in message
...
Hello,

I have a large data file in 2 columns:
1st column = Employee ID
2nd Column = Salary

I want to find combinations of salaries whose total equals a certain
amount
and identify those employees. Please any suggestions on how should I
proceed?
What formula to use?

Thanks for your assistance.

al



  #3   Report Post  
Posted to microsoft.public.excel.misc
atmbonda
 
Posts: n/a
Default find all employees whose total salaries equal a given amount

Thanks Peo,
Please let me clarify the question. You have the following

EE Name Salary
Peter 89
Paul 41
John 76
Richard 59
Santiago 10
Earl 52
Carl 22

I want to find the employees whose total salaries = 51.
Because the dataset here is not huge, I see that those employees are Paul &
Santiago. I am wondering how can I have the answer by using a formula in the
case of a large data set. Will your suggestion work in this case?

Thanks again.

al


"Peo Sjoblom" wrote:

You need the solver add-in for this

"put the data set in let's say A2:A8, in B2:B8 put a set of ones {1,1,1 etc}
in the adjacent cells
in C2 put 8, in D2 put

=SUMPRODUCT(A2:A7,B2:B7)


select D2 and do toolssolver, set target cell $D$2 (should come up
automatically if selected)


Equal to a Value of 8, by changing cells $B$2:$B$7, click add under Subject
to the constraints of:
in Cell reference put


$B$2:$B$7


from dropdown select Bin, click OK and click Solve, Keep solver solution
and look at the table


2 1
4 0
5 0
6 1
9 0
13 0


there you can see that 4 ones have been replaced by zeros and the adjacent
cells to the 2 ones total 8 "



adapt to fit


--


Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"atmbonda" wrote in message
...
Hello,

I have a large data file in 2 columns:
1st column = Employee ID
2nd Column = Salary

I want to find combinations of salaries whose total equals a certain
amount
and identify those employees. Please any suggestions on how should I
proceed?
What formula to use?

Thanks for your assistance.

al




  #4   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default find all employees whose total salaries equal a given amount

Yes, I just did a quick test suing your example, I put your example in A1:B2
with the salaries in B2:B8, in C2:C8 I put 1, in D2 I put

=SUMPRODUCT(B2:B8,C2:C8)

set target cell $D$2, equal to value of 51, click add and select $C$2:$C$8,
then from dropdown binary, then OK and solve, the result looked like

Names Salaries
Peter 89 0 51
Paul 41 1
John 76 0
Richard 59 0
Santiago 10 1
Earl 52 0
Carl 22 0


hope it isn't too warped up, as you can see the 2 1s indicates where
solution is, before solver was applied there were only ones in C2 C8 now the
only ones are those for Paul and Santiago and if you apply an autofilter and
filter on 1 in column C you will get those 2 names visible only in column A
and their salaries in B. It might take a few minutes with a larger data set
but it certainly can work

--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com




"atmbonda" wrote in message
...
Thanks Peo,
Please let me clarify the question. You have the following

EE Name Salary
Peter 89
Paul 41
John 76
Richard 59
Santiago 10
Earl 52
Carl 22

I want to find the employees whose total salaries = 51.
Because the dataset here is not huge, I see that those employees are Paul
&
Santiago. I am wondering how can I have the answer by using a formula in
the
case of a large data set. Will your suggestion work in this case?

Thanks again.

al


"Peo Sjoblom" wrote:

You need the solver add-in for this

"put the data set in let's say A2:A8, in B2:B8 put a set of ones {1,1,1
etc}
in the adjacent cells
in C2 put 8, in D2 put

=SUMPRODUCT(A2:A7,B2:B7)


select D2 and do toolssolver, set target cell $D$2 (should come up
automatically if selected)


Equal to a Value of 8, by changing cells $B$2:$B$7, click add under
Subject
to the constraints of:
in Cell reference put


$B$2:$B$7


from dropdown select Bin, click OK and click Solve, Keep solver solution
and look at the table


2 1
4 0
5 0
6 1
9 0
13 0


there you can see that 4 ones have been replaced by zeros and the
adjacent
cells to the 2 ones total 8 "



adapt to fit


--


Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"atmbonda" wrote in message
...
Hello,

I have a large data file in 2 columns:
1st column = Employee ID
2nd Column = Salary

I want to find combinations of salaries whose total equals a certain
amount
and identify those employees. Please any suggestions on how should I
proceed?
What formula to use?

Thanks for your assistance.

al






  #5   Report Post  
Posted to microsoft.public.excel.misc
atmbonda
 
Posts: n/a
Default find all employees whose total salaries equal a given amount

Thanks Peo,

I followed your advice with a small data set and it did work, thanks a lot.
The problem, however, is that when I tried to replicate what you taught me
in a large data set (5000 rows), I got an error message that read: "Too many
adjustable cells". If you or somebody else has an alternate route, I would
love to know what it is. Otherwise I will thank you for your pointer. I
learned something new.

Have a terrific week-end!

Al

"Peo Sjoblom" wrote:

Yes, I just did a quick test suing your example, I put your example in A1:B2
with the salaries in B2:B8, in C2:C8 I put 1, in D2 I put

=SUMPRODUCT(B2:B8,C2:C8)

set target cell $D$2, equal to value of 51, click add and select $C$2:$C$8,
then from dropdown binary, then OK and solve, the result looked like

Names Salaries
Peter 89 0 51
Paul 41 1
John 76 0
Richard 59 0
Santiago 10 1
Earl 52 0
Carl 22 0


hope it isn't too warped up, as you can see the 2 1s indicates where
solution is, before solver was applied there were only ones in C2 C8 now the
only ones are those for Paul and Santiago and if you apply an autofilter and
filter on 1 in column C you will get those 2 names visible only in column A
and their salaries in B. It might take a few minutes with a larger data set
but it certainly can work

--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com




"atmbonda" wrote in message
...
Thanks Peo,
Please let me clarify the question. You have the following

EE Name Salary
Peter 89
Paul 41
John 76
Richard 59
Santiago 10
Earl 52
Carl 22

I want to find the employees whose total salaries = 51.
Because the dataset here is not huge, I see that those employees are Paul
&
Santiago. I am wondering how can I have the answer by using a formula in
the
case of a large data set. Will your suggestion work in this case?

Thanks again.

al


"Peo Sjoblom" wrote:

You need the solver add-in for this

"put the data set in let's say A2:A8, in B2:B8 put a set of ones {1,1,1
etc}
in the adjacent cells
in C2 put 8, in D2 put

=SUMPRODUCT(A2:A7,B2:B7)


select D2 and do toolssolver, set target cell $D$2 (should come up
automatically if selected)


Equal to a Value of 8, by changing cells $B$2:$B$7, click add under
Subject
to the constraints of:
in Cell reference put


$B$2:$B$7


from dropdown select Bin, click OK and click Solve, Keep solver solution
and look at the table


2 1
4 0
5 0
6 1
9 0
13 0


there you can see that 4 ones have been replaced by zeros and the
adjacent
cells to the 2 ones total 8 "



adapt to fit


--


Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"atmbonda" wrote in message
...
Hello,

I have a large data file in 2 columns:
1st column = Employee ID
2nd Column = Salary

I want to find combinations of salaries whose total equals a certain
amount
and identify those employees. Please any suggestions on how should I
proceed?
What formula to use?

Thanks for your assistance.

al









  #6   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default find all employees whose total salaries equal a given amount

OK, I understand, I didn't know how big this task was, the solver that comes
with Excel is a less powerful one than what is available, here's a link

http://www.solver.com/exceluse.htm

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey


"atmbonda" wrote in message
...
Thanks Peo,

I followed your advice with a small data set and it did work, thanks a
lot.
The problem, however, is that when I tried to replicate what you taught me
in a large data set (5000 rows), I got an error message that read: "Too
many
adjustable cells". If you or somebody else has an alternate route, I would
love to know what it is. Otherwise I will thank you for your pointer. I
learned something new.

Have a terrific week-end!

Al

"Peo Sjoblom" wrote:

Yes, I just did a quick test suing your example, I put your example in
A1:B2
with the salaries in B2:B8, in C2:C8 I put 1, in D2 I put

=SUMPRODUCT(B2:B8,C2:C8)

set target cell $D$2, equal to value of 51, click add and select
$C$2:$C$8,
then from dropdown binary, then OK and solve, the result looked like

Names Salaries
Peter 89 0 51
Paul 41 1
John 76 0
Richard 59 0
Santiago 10 1
Earl 52 0
Carl 22 0


hope it isn't too warped up, as you can see the 2 1s indicates where
solution is, before solver was applied there were only ones in C2 C8 now
the
only ones are those for Paul and Santiago and if you apply an autofilter
and
filter on 1 in column C you will get those 2 names visible only in column
A
and their salaries in B. It might take a few minutes with a larger data
set
but it certainly can work

--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com




"atmbonda" wrote in message
...
Thanks Peo,
Please let me clarify the question. You have the following

EE Name Salary
Peter 89
Paul 41
John 76
Richard 59
Santiago 10
Earl 52
Carl 22

I want to find the employees whose total salaries = 51.
Because the dataset here is not huge, I see that those employees are
Paul
&
Santiago. I am wondering how can I have the answer by using a formula
in
the
case of a large data set. Will your suggestion work in this case?

Thanks again.

al


"Peo Sjoblom" wrote:

You need the solver add-in for this

"put the data set in let's say A2:A8, in B2:B8 put a set of ones
{1,1,1
etc}
in the adjacent cells
in C2 put 8, in D2 put

=SUMPRODUCT(A2:A7,B2:B7)


select D2 and do toolssolver, set target cell $D$2 (should come up
automatically if selected)


Equal to a Value of 8, by changing cells $B$2:$B$7, click add under
Subject
to the constraints of:
in Cell reference put


$B$2:$B$7


from dropdown select Bin, click OK and click Solve, Keep solver
solution
and look at the table


2 1
4 0
5 0
6 1
9 0
13 0


there you can see that 4 ones have been replaced by zeros and the
adjacent
cells to the 2 ones total 8 "



adapt to fit


--


Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"atmbonda" wrote in message
...
Hello,

I have a large data file in 2 columns:
1st column = Employee ID
2nd Column = Salary

I want to find combinations of salaries whose total equals a certain
amount
and identify those employees. Please any suggestions on how should I
proceed?
What formula to use?

Thanks for your assistance.

al









  #7   Report Post  
Posted to microsoft.public.excel.misc
R. Choate
 
Posts: n/a
Default find all employees whose total salaries equal a given amount

Just to be clear, you want one or more combinations of salaries which add up to exactly a given amount. You are not looking for
salaries which exceed a given threshhold, or when combined exceed a given threshhold or something like that? Sometimes the question
is worded such that the solution for the problem, as stated, is much more complicated than is what the person actually was looking
for. Miscommunication is a big player in the NGs. Believe me, I've miscommunicated lots of problems and I've caused much more brains
cells to be expended than were due.

Richard
--
RMC,CPA


"atmbonda" wrote in message ...
Hello,

I have a large data file in 2 columns:
1st column = Employee ID
2nd Column = Salary

I want to find combinations of salaries whose total equals a certain amount
and identify those employees. Please any suggestions on how should I proceed?
What formula to use?

Thanks for your assistance.

al


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set a formula in a cell to equal the total in another ce. dizzyd Excel Worksheet Functions 1 March 18th 05 05:50 PM
find parts of a total Jim Excel Worksheet Functions 1 February 22nd 05 08:07 PM
a formula to find total compound amount after given number of yea. ronan Excel Worksheet Functions 1 February 1st 05 08:15 PM
how do I set up a total amount automatically in excel sue Excel Worksheet Functions 2 January 23rd 05 05:35 PM
To find a combination of numbers that equal a set amount? Larry Morris Excel Discussion (Misc queries) 6 December 17th 04 05:39 PM


All times are GMT +1. The time now is 09:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"