Edited when i realised I'm 1% going the wrong way! Hex2dec will convert from hexadecimal to decimal =if(left(a12)==xif(hex2dec(right(a1Len(a1)-2)32768hex2dec(right(a1Len(a1)-2)-65536hex2dec(right(a1Len(a1)-2)))not hex Original answer this is actually very simple as excel supplies the dec2hex function. =CONCATENATE(xRIGHT(CONCATENATE( DEC2HEX(A1))4))