Dynamic formulas in Apex now support using an Sobject as the context object
How: Use the new Formula.builder() method to create and build an instance of the FormulaBuilder and uses an SObject type as the context object in the withType() method
// Below formula will be true when account Type is populated
FormulaEval.FormulaInstance ff = Formula.builder()
.withReturnType(FormulaEval.FormulaReturnType.Boolean)
.withType(Account.SObjectType)
.withFormula('NOT(ISBLANK(TEXT(Type)))')
.build();
Boolean typeIsNotBlank = (Boolean)ff.evaluate(new Account(Name='Test Account', Type='Prospect'));
Assert.isTrue(typeIsNotBlank);