×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Microsoft Excel: How to Get 'Parts' to Equal 'Total'

Microsoft Excel: How to Get 'Parts' to Equal 'Total'

Microsoft Excel: How to Get 'Parts' to Equal 'Total'

(OP)
I have a column of numbers (see 'Qty' column on attached file) that need to be divided in half and the resulting values placed in columns b and c.

I use the ROUND function in order to do the calculation. However, when the 'parts' are added together, the sum does not always add back up to the original total.

How do I get the result of each division (rows 2-11) to add back up to each original Qty.

Thank you for assistance!

RE: Microsoft Excel: How to Get 'Parts' to Equal 'Total'

Hi,

Guess what: you have 7 odd numbers in Qty and you have a variance of... 7!

PkgB values should be Qty - PkgA.
Qty	PkgA	PkgB	Variance
30	15	15	0 
76	38	38	0 
91	46	45	0 
55	28	27	0 
67	34	33	0 
63	32	31	0 
39	20	19	0 
44	22	22	0 
43	22	21	0 
53	27	26	0 
			
Total			
561	284	277	0 
 

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

RE: Microsoft Excel: How to Get 'Parts' to Equal 'Total'

(OP)
Yes, Skip, I know the odd numbers are causing the calculation issues.

I'm seeking a formula to copy down down 10M+ rows in columns b & c that will accomplish the following:
1. For each line (before total line), the formula in columns b & c will return a variance of 0 in column d.
2. The total line for columns b & c will be close to 50%-50% (e.g. 280+281).

Thanks in advance for feedback.

RE: Microsoft Excel: How to Get 'Parts' to Equal 'Total'

Well now you moved the goalposts!

Is there anything else we ought to know before venturing a solution to the new and improved requirements?

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

RE: Microsoft Excel: How to Get 'Parts' to Equal 'Total'

Here's my solution to your current requirements...
Qty	PkgA	PkgB	Variance
30	15	15	0 
76	38	38	0 
91	46	45	0 
55	27	28	0 
67	34	33	0 
63	31	32	0 
39	20	19	0 
44	22	22	0 
43	21	22	0 
53	27	26	0 
			
Total			
561	281	280	0 
 


PkgB: =Qty-PkgA
B2: =IF(NOT(ISNUMBER(A1)),0,IF(SUM(A1:A$2)/2-SUM(B1:B$2)<0,IF(MOD(A2,2)=1,-1,0)))+ROUND(A2/2,0)

Copy cell B2 & PASTE Down thru all rows.

The other thing I'd do is put your totals above your table. No one wants to hunt for the payoff. Totals at the bottom of a table/report is reminiscent of paper, pencil, calculator, page subtotals and grand totals. We're way past that.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close