How to create a GUID in Excel?

后端 未结 14 2229
天涯浪人
天涯浪人 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 20:44

    =LOWER(
        CONCATENATE(
            DEC2HEX(RANDBETWEEN(0,POWER(16,8)),8), "-", 
            DEC2HEX(RANDBETWEEN(0,POWER(16,4)),4),"-","4", 
            DEC2HEX(RANDBETWEEN(0,POWER(16,3)),3),"-",
            DEC2HEX(RANDBETWEEN(8,11)),
            DEC2HEX(RANDBETWEEN(0,POWER(16,3)),3),"-",
            DEC2HEX(RANDBETWEEN(0,POWER(16,8)),8),
            DEC2HEX(RANDBETWEEN(0,POWER(16,4)),4)
        )
    )
    

    Taken from git @mobilitymaster.

提交回复
热议问题