title: Excel Vlookup formula for pivot table reference
body: <p>I have a nutrition database pivot table on one sheet and a meal planner on the other. When I enter the food I want to reference the other cells to lookup it's values from the pivot table. I can do this but my problem is that if I add more columns to the table it's all out of sync.</p>
  
  <pre><code>=IFERROR(VLOOKUP($C7,NutritionDatabase,6,FALSE),0)
  </code></pre>
  
  <p>If I enter the food into C7, I'm currently using this formula above to lookup the kcals per 100g in the 6th column of my NutritionDatabase pivot table.</p>
  
  <p>Is there any way to lookup the column title and reference the data from the same row as the food in C7. NutritionDatabase[[#This Row],[Kcalsp100]]</p>
  
  <p>Something along the lines of this below but except this doesn't work?</p>
  
  <pre><code>=VLOOKUP($C7,NutritionDatabase[[#This Row],[Kcalsp100]],FALSE)
  </code></pre>
  
  <p>Would you be able to offer any experience and tips, please?</p>
  
  <p>This would be very useful because in the future I want to expand the NutritionDatabase by adding more data and columns, if I'm referencing the column number then I'm going to have to change everything when I do that.</p>
  
  <p><a href="https://i.stack.imgur.com/iwKxS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iwKxS.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/a05wG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a05wG.png" alt="enter image description here"></a></p>
  
  <p>Thanks!</p>