I need a function to add a GUID to cells in excel. I found this previous question on stackoverflow, but it is not working. It suggests the following function:
=CO
ESP:
=CONCATENAR(
DEC.A.HEX(ALEATORIO.ENTRE(0;4294967295);8);"-";
DEC.A.HEX(ALEATORIO.ENTRE(0;42949);4);"-";
DEC.A.HEX(ALEATORIO.ENTRE(0;42949);4);"-";
DEC.A.HEX(ALEATORIO.ENTRE(0;42949);4);"-";
DEC.A.HEX(ALEATORIO.ENTRE(0;4294967295);8);
DEC.A.HEX(ALEATORIO.ENTRE(0;42949);4)
)
As of modern version of Excel, there's the syntax with commas, not semicolons. I'm posting this answer for convenience of others so they don't have to replace the strings- We're all lazy... hrmp... human, right?
=CONCATENATE(DEC2HEX(RANDBETWEEN(0,4294967295),8),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,4294967295),8),DEC2HEX(RANDBETWEEN(0,42949),4))
Or, if you like me dislike when a guid screams and shouts and you, we can go lower-cased like this.
=LOWER(CONCATENATE(DEC2HEX(RANDBETWEEN(0,4294967295),8),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,4294967295),8),DEC2HEX(RANDBETWEEN(0,42949),4)))