Alan Medic Posted November 18, 2015 Share Posted November 18, 2015 Wonder if anyone can tell me if there is a way of doing this? I have a series of values (which could be either negative or positive) that will add up to Zero. However I don?t know which are positive or which are negative.Is there a way of calculating how these numbers being one way or the other will add up to Zero and if there is more than one way of doing it?I?m being lazy here as I should be able to deduce which is a negative or a positive and am just looking for a quicker option. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/ Share on other sites More sharing options...
Jeremy Posted November 18, 2015 Share Posted November 18, 2015 Are you talking about methodically assigning +ve/-ve signs to each number until you reach a solution?Easy to code in VBA.. but if your data set is large, you might find it surpisingly slow to compute. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927522 Share on other sites More sharing options...
*Bob* Posted November 18, 2015 Share Posted November 18, 2015 Fun times. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927526 Share on other sites More sharing options...
???? Posted November 18, 2015 Share Posted November 18, 2015 Is this a new full proof betting system Mr Medic? Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927528 Share on other sites More sharing options...
Mick Mac Posted November 18, 2015 Share Posted November 18, 2015 fool proof? Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927531 Share on other sites More sharing options...
red devil Posted November 18, 2015 Share Posted November 18, 2015 What happens if there's more than one permutation?... Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927534 Share on other sites More sharing options...
ed_pete Posted November 18, 2015 Share Posted November 18, 2015 Assuming none of the values are themselves zero, then there are (2 x (2^(n-1))-2 permutations of positive and negative numbers. e.g. 5 numbers = 30 permutations.But in short there is no easy way to do this in Excel without resorting to VBA as Jeremy says. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927542 Share on other sites More sharing options...
Jeremy Posted November 18, 2015 Share Posted November 18, 2015 It's just 2^n, isn't it? Soon becomes intractable with a large set. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927546 Share on other sites More sharing options...
miga Posted November 18, 2015 Share Posted November 18, 2015 ed_pete: (2 x (2^(n-1)) a.k.a 2^n, and not sure where - 2 comes from, are you maybe forgetting all/no - or all/no +?With no further restrictions, reckon Jeremy's right.There are some vaguely similar counting/summing problems which you can do in order of n steps, but these tend to have a kind of "ordering" implicit in them, such as finding the point in a set which gives two parts, the sums of each respective part giving minimal absolute difference. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927552 Share on other sites More sharing options...
ed_pete Posted November 18, 2015 Share Posted November 18, 2015 Surely all positive or all negative can't sum to zero ? Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927554 Share on other sites More sharing options...
Alan Medic Posted November 18, 2015 Author Share Posted November 18, 2015 Jeremy Wrote:-------------------------------------------------------> Are you talking about methodically assigning> +ve/-ve signs to each number until you reach a> solution?> > Easy to code in VBA.. but if your data set is> large, you might find it surpisingly slow to> compute.We're talking about less than 40 values which already have a plus or minus assigned to them as a result of a reconciliation. However these add up to over ?4,000 in value. By a process of deduction, a plus or a minus can be reversed depending of the reason it is what it is in the first place. With the correct alterations the sum of the numbers will be zero.May be easy to code in VBA if you know how. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927556 Share on other sites More sharing options...
Alan Medic Posted November 18, 2015 Author Share Posted November 18, 2015 ed_pete Wrote:-------------------------------------------------------> Surely all positive or all negative can't sum to> zero ?Right. But they are not all one or the other. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927558 Share on other sites More sharing options...
Alan Medic Posted November 18, 2015 Author Share Posted November 18, 2015 red devil Wrote:-------------------------------------------------------> What happens if there's more than one> permutation?...I'll have to think. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927559 Share on other sites More sharing options...
Alan Medic Posted November 18, 2015 Author Share Posted November 18, 2015 ???? Wrote:-------------------------------------------------------> Is this a new full proof betting system Mr Medic?Nah. Only 40%. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927560 Share on other sites More sharing options...
Jeremy Posted November 18, 2015 Share Posted November 18, 2015 You can do it using Excel "Solver"Example here - very similar to what you need to dohttp://www.k2e.com/tech-update/tips/147-using-excel-to-identify-entries-that-add-to-a-specific-value Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927567 Share on other sites More sharing options...
miga Posted November 18, 2015 Share Posted November 18, 2015 ed_pete Wrote:-------------------------------------------------------> Surely all positive or all negative can't sum to> zero ?Yep, fair enough. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927569 Share on other sites More sharing options...
red devil Posted November 18, 2015 Share Posted November 18, 2015 *Waves at El Pibe*...his kinda thread Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927575 Share on other sites More sharing options...
Jah Lush Posted November 18, 2015 Share Posted November 18, 2015 I have absolutely no idea what you're on about.As a gambling man is it some new way for you to try and weigh up the pros and cons of the odds at stake? Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927576 Share on other sites More sharing options...
Alan Medic Posted November 18, 2015 Author Share Posted November 18, 2015 Jeremy Wrote:-------------------------------------------------------> You can do it using Excel "Solver"> > Example here - very similar to what you need to> do> http://www.k2e.com/tech-update/tips/147-using-exce> l-to-identify-entries-that-add-to-a-specific-valueThanks Jeremy. Will try that after eating my rice cakes with peanut butter and banana. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927578 Share on other sites More sharing options...
red devil Posted November 18, 2015 Share Posted November 18, 2015 Going to be windy tonight... Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927587 Share on other sites More sharing options...
Jeremy Posted November 18, 2015 Share Posted November 18, 2015 It will take a bloody long time though. With 40 numbers, that is one trillion combinations to test... Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927592 Share on other sites More sharing options...
Help-Ma-Boab Posted November 18, 2015 Share Posted November 18, 2015 Ha Ha RD....same thoughts. straight out the EP guide to breaking the ice at a party this one!red devil Wrote:-------------------------------------------------------> *Waves at El Pibe*...his kinda thread Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927595 Share on other sites More sharing options...
Mick Mac Posted November 18, 2015 Share Posted November 18, 2015 Help-Ma-Boab Wrote:-------------------------------------------------------> Ha Ha RD....same thoughts. straight out the EP> guide to breaking the ice at a party this one!> :) Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927609 Share on other sites More sharing options...
???? Posted November 18, 2015 Share Posted November 18, 2015 Someone let him know his ears must be burning :) Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-927666 Share on other sites More sharing options...
HopOne Posted November 20, 2015 Share Posted November 20, 2015 This is called the subset sum problem and will take a lot of number crunching. If you can break the problem down into a number of sums that are all positive or all negative then it will be much quicker to solve. Link to comment https://www.eastdulwichforum.co.uk/topic/83508-excel-query/#findComment-928567 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now