if only vs only if

if only

conj
  • Used other than figuratively or idiomatically: see if, only. 

  • I wish that; signifies a wish or desire for the present or the future. 

  • I wish that; signifies a regret about an action in the past. 

  • Even if for no other reason than; only just. 

only if

conj
  • Not unless; used to introduce a necessary condition. 

How often have the words if only and only if occurred in a corpus of books? (source: Google Ngram Viewer )