You are correct, I'm using Excel VBA. I don't need to convert back, I was just testing your routines and it seemed to me the reverse should work. My ultimate goal is to calculate Microsoft color shading and I found other code that's supposed to be able to apply a shading percentage to HSL (but it doesn't work). If only MS would publish their algorithm or just put the all color numbers in the XML files. Here's some more debugging:
RGBtoHSL: 13020235 to [H] 128.455284552846, 124.556962025316, [L] 128.470588235294
----------------------------------------
============ HSLtoRGB ============
h=0.356820234869017
s=1.24556962025316
l=1.28470588235294
x1=1.63932688011913
x2=0.930084884586748
red=418.028354430379
green=237.171645569621
blue=392.541772151897
===================================
HSLtoRGB: 16772607 from [H] 128.455284552846, 124.556962025316, [L] 128.470588235294
HSLtoRGB: [R] 0, [G] 0, 0
----------------------------------------
As you can see, the red, green, and blue values come out high from HUEtoRGB function in HSLtoRGB function. I used your routines verbatim (other than adding Debug.Print statements).
RGBtoHSL: 13020235 to [H] 128.455284552846,
----------------------------------------
============ HSLtoRGB ============
h=0.356820234869017
s=1.24556962025316
l=1.28470588235294
x1=1.63932688011913
x2=0.930084884586748
red=418.028354430379
green=237.171645569621
blue=392.541772151897
===================================
HSLtoRGB: 16772607 from [H] 128.455284552846,
HSLtoRGB: [R] 0, [G] 0, 0
----------------------------------------
As you can see, the red, green, and blue values come out high from HUEtoRGB function in HSLtoRGB function. I used your routines verbatim (other than adding Debug.Print statements).