Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9624

Assigning ID automatically using Arrayformula and text

$
0
0

I'm probably approaching this wrong but I'm trying to automatically assign an ID to an item, I'd like the format to be C#### where #### starts with 0s and is assigned as 0001.

The expected output would be C0001, C0002, C0003... C9999

={"UID"; ARRAYFORMULA(if(D2:D="", "", ("C"&(text(row(D2:D)-1), "####"))))}

Without the text formatting, it has no issues assigning the first item as C1. If I assign the preceding 0's, it would generate as C0001... C00011 as opposed to C0011.

Thanks in advance for your help.


Viewing all articles
Browse latest Browse all 9624

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>