To determine the cost per portion of a recipe, you must first add to find the total cost of the ingredients, then divide that total by the number of servings the recipe makes.
Keep track how much you paid for ingredients. As you add them write down the cost that. Figure out the total and divide it by how many servings you get.