OSX Numbers Checking for either of two text values
You actually have the answer there. Take the difference of the two formulae.
The logic is count all those having Hello + all haveing world - those having both so
COUNTIF(A1:A7;"hello")+COUNTIF(A1:A7;"world") - COUNTIFS(A1:A7;"hello";A1:A7;"world")