4 Random Numbers that equal the same Total

girlfriday

New Member
Joined
Jan 21, 2014
Messages
6
Could you tell me how to make a Excel spreadsheet where I could make 4 random numbers that when added together will equal the same total?

Such as the total is 21 so different 4 numbers would be 3558, 3648, 3747, 3828, etc

So I want to have a different total each time and the 4 digit numbers will be automatically generated for me.

Thank you ever so much!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Girl Friday is strangely quiet... she sets a nice challenge but does not offer clarification....

So, into a room full of men, walks a woman (presumably reasoned because of the name "girlfriday") who poses a question that is open to interpretation by the different individuals who listen. Then she leaves the room. Thus leaving the men to get into long conversations about what is really required .... How many times has that happened!? It's like déjà vu, déjà vu at a singles bar for me.

I think what girlfriday is actually seeking is a permutation of numbers with the restriction that the sum of four digits result as 21 (or whatever number of her choosing).
So, concerning the number 21, as in the example given; 3558, 3648, 3747, 3828, the sum of the four digits is 21.
We are not looking at the numbers 3558, 3648, 3747, 3828 as a whole, but rather as; 3+5+5+8=21 and 3+6+4+8=21 and 3+7+4+7=21 and 3+8+2+8=21 etc.

I'd just refer her to a topic of permutation without repeats.
 
Last edited:
Upvote 0
I think GirlFriday is a teacher and is trying to set easy maths sums for 6 -7 year olds, but she can't add up 3+6+4+8 herself. She teaches in a UK school, the maths teacher is off with stress and GirlFriday, the PE teacher, is covering.
 
Upvote 0
I should have looked at this sooner. Wow this is wonderful. I realize the sum number will not be able to be below 15 I think as then the integers will have negative numbers in them. Also the sum would not be able to be above a certain number as the single integer would be higher than 9. I will try some of these options. Thank you very very much!
 
Upvote 0
Jim885 thanks for the laugh. I did come in and pose the question, waited a bit and no answer so I left and not to return for 3 months. Sorry about that all you men ;)
 
Upvote 0
oldbrewer I am not a teacher working in the UK. Ha ha Thank you for the laugh too! I basically want the formula to make up a four digit number that adds up to a predetermined sum for different people in the field as tickets. If the tickets that are handed in that don't add up to this predetermined number then we know that they are fraudulent. Hope that makes sense.
 
Upvote 0
oldbrewer I am not a teacher working in the UK. Ha ha Thank you for the laugh too! I basically want the formula to make up a four digit number that adds up to a predetermined sum for different people in the field as tickets. If the tickets that are handed in that don't add up to this predetermined number then we know that they are fraudulent. Hope that makes sense.

If your intent is to identify fradulent tickets, why not use a check digit as the 4th digit of the number. It is computed from the first 3 digits. Several check digit routines are available or you could make your own. Something as simple as the last digit of the sum of the first 3 digits.
 
Upvote 0
I will try to clarify things. I want to make a month worth of tickets that all the 4 numbers on them will equal to the predetermined number. For an example I plug in the number 21 (this can be 16, 17 , 18 etc) The integers have to be 0 - 9 so for an example 3891,3882,3873,3864,3855,3846,3837,3828,3819 etc etc So I need a formula to plug into excel that would do this for me. So for this month the sum number was 18, next month would be 24, the next month could be 16. This way every worker that sees this 4 digit number will see it and add it up and if it adds up to the predetermined sum (they were given the number via a email memo at the beginning of the month) number then the ticket is legitimate and if it doesn't equal the number then the tick is fraudulent and the bum is thrown out. (LOL just kidding) Hope this makes sense. If you understand and have a formula for this in Excel I will be forever thankful
 
Upvote 0
Hi Redwolfx I am trying your formula and so far it looks good and it is working. This looks like this is the one! Thank you very much!
 
Upvote 0
It seems to me that an easier way to approach the problem is rather than generating "all numbers that sum to the desired target" one could create a column 0000-9999, then have a helper column that sums the digit with a simple formula, then use Auto-Filter on the helper column, to isolate the numbers whose sum is the desired target.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top