I have a column "HEX" and three columns "R", "G" and "B".
How to convert HEX to RGB (e.g. ff0000 to R = 255, G = 0 and B = 0)?
I know that the first 2 characters of "ff" belong to "R", the next 2 "00" belong to "G", and the final 2 "00" belongs to "B".
Therefore, I will have to use =LEFT(A1, 2)for "R", =RIGHT(LEFT(A1, 4), 2)and =RIGHT(A1, 2)for the latter.
But how to convert ffto 255and 00to 0, etc.? I think I have to do something to parse the hexadecimal (base 16) to decimal (base 10)?
I would like to do this without VBA.
source
share