How to Apply Operations inside of IF statements

I have a basic IF statement

=IF(C41="Total","5","4")

That checks if C41 contains the Word total and returns 5 if yes and 4 if no.

How do I get it to return 5+2 if correct?

=IF(C41="Total","5+2","4")

Returns the string “5+2”

and

=IF(C41="Total",5+2,"4")

Returns TRUE

im sure this is something small and stupid I missed, but i can’t figure out the syntax. let me know.

Your last expression is correct; but you must have set your cell’s format to logic while experimented with the IF, so now it shows TRUE for any non-0 number. Remove the formatting, e.g. Ctrl+M.

This. Oh my god I thought I was losing my mind tyvm!!!

I am using LO 5.4 and using the last example you gave - =IF(C41=“Total”,5+2,“4”) returns 7
Is that what you are wanting to do ?