It depends on the recipe. Yogurt is a very different taste than ricotta. Also, ricotta is very high in fat, yogurt is much less fattening. Yogurt is smooth, ricotta is not. This may work for a sweet dessert, but if the recipe would work best with a smooth, lower-fat ingredient, then stick with yogurt.