An empirical metallicity tracer in CEMP and C-normal stars