Not all RGB values will be a perfect on screen match the first time, but you can find a closer HEX web value match by tweaking these different values. Start with RGB then tweak the values until close to the target, then adjust the HSL (Hue, Saturation, Lightness) to home-in on a visual match to the printed sample. The final screen color will also show the CMYK value if you apply web images created in that color space.
Before any matching, always calibrate your monitor. But, remember… not all monitors, phones, or tablets will show the same color and users calibration habits may not follow best practices.