Smart grids are indispensable applications in smart connected communities (SCC). To construct privacy-preserving anomaly detection systems on a smart grid, we adopt fully homomorphic encryption (FHE) to protect users' sensitive data. Although FHE allows a third party to perform calculations on encrypted data without decryption, FHE only supports addition and multiplication on encrypted data. In anomaly detection, we must calculate both harmonic and arithmetic means consisting of logarithms. A naïve implementation of such arithmetic operations with FHE is a bitwise operation; thus, it requires huge computation time. To speed up such calculations, we propose an efficient protocol to evaluate any functions with FHE using a lookup table (LUT). Our protocol allows integer encoding, i.e., a set of integers is encrypted as a single ciphertext, rather than using bitwise encoding. Our experimental results in a multi-threaded environment show that the runtime of our protocol is approximately 51 s when the size of the LUT is 448,000. Our protocol is more practical than the previously proposed bitwise implementation.