I have not found a way to “automate” the reverse lookup.
I like to use the Photoshop colour picker. There are a number of factors at play here.
First Lab colour is the intermediate “translation” space.
Modern Pantone spot colour library files are based on Lab values.
CMYK numbers have no definition of “colour” by themselves, when an ICC profile is associated with the CMYK values, then we have a known Lab colour.
In the case of a CMYK to Spot lookup, the CMYK values are associated with a given ICC profile and rendering intent, which produces a specific Lab colour value. The Lab colour value is then compared to the spot colour library Lab colour value. I am not sure what method Photoshop uses for the “closest match”. If using a spot colour instead of CMYK, one has to consider whether the spot colour is close to/limited to a particular press CMYK colour gamut - or does it use a wider gamut spot colour (not close to the CMYK colour, however it will probably be a “better” colour).
Stephen Marsh