It should work with both of those conditions. Just update the appropriate range references