Create a transaction ID from dataset in excel

bongouni553

New Member
Joined
May 24, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all
I need your assistance with the following on excel,

  • The unique TransactionID consists of 13 characters. You need to create a function that will create this unique TransactionID.
  • First four character: A combination of any four number of the alphabet (A-Z,a-z).
  • Second group of four characters: The first four characters of the employeee number (0-9).
  • Dash between the second and third group of characters.
  • Next group of 3 characters: Random number between 100 and 999.
  • Last number: Control number: The remainder when the last group of 3 numbers, is divided by 7. For example: 129 div 7 = 18 and the remainder is 4.
  • I have for example employee number in one of my fields 1209090 in excel
  • the transtacitonid should be like Abxy1209-1294
  • I have a function with the following CHAR(RANDBETWEEN(65;90))&CHAR(RANDBETWEEN(65;90))&CHAR(RANDBETWEEN(65;90))&CHAR(RANDBETWEEN(65;90))&RANDBETWEEN(0;999) but its not working as desired .
  • I need to also use the mod am stuck .
Thanks for your help
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
i'm hoping this is not homework

does
=CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&LEFT(C1,4)&"-"&LET(r,RANDBETWEEN(0,999),r*1&"-"&MOD(r,7))

work for you
as you have excel 365 , you can use LET - so the random number is assigned to a variable and can be used more than once for the same number

129 / 7 = 18
18*7 = 126
remainder 3

Book1
ABCDEFG
1GKCY1209-591-31209090UGRQ1209-743-1
2375-4
33
Sheet1
Cell Formulas
RangeFormula
A1A1=CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&LEFT(C1,4)&"-"&LET(r,RANDBETWEEN(0,999),r*1&"-"&MOD(r,7))
A2A2=LET(r,RANDBETWEEN(0,999),r*1&"-"&MOD(r,7))
A3A3=MOD(129,7)
 
Upvote 0
you are welcome,
was this homework / assignment
as the wording in the question
You need to create a function that will create this unique TransactionID.
Implied it might be
if so, then thanks for at least having a go with the formula - a lot do not bother to try
I hope , if its homework, you fully understand why I used the LET ()
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

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