If...otherwise

Hello!
In c column we have X or nothing (empty).
Now, we have to count M column

it should be:
if(and(C5=“X”;C6=“X”);J6*K6)

But,
In a case that c5 and /or c6 is NOT filed with X (so, it is empty), we want another formula to be counted (j6/k6)
Please, how to write the whole expression?
Many thanks!

if(and(C5=“X”;C6=“X”);J6*K6;J6/K6)