Problems with displaying different sensor values on lcd with ir sensor.

Create the functions in the ONE ino file.

After loop(), put
/* Code to be sorted out *
/* */

Move ALL the code in loop() to between those two lines.

Put ONLY the function calls I suggested in loop().

Add a new global variable to hold whatToDisplay.

Move the code that should set that variable into the determineWhatToDisplay() function, and set that variable.

Get that to compile, and print the variable whatToDisplay any time it changes. Even though the code won't actually accomplish anything, post that code, so that we can see that you recognized all the code that belongs in that function.