How to create a GUID in Excel?

后端 未结 14 2203
天涯浪人
天涯浪人 2021-01-30 20:16

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         


        
相关标签:
14条回答
  • 2021-01-30 21:03

    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)
    )
    
    0 讨论(0)
  • 2021-01-30 21:04

    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)))

    0 讨论(0)
提交回复
热议问题