SUMs and VLookup Issues

alphairri

New Member
Joined
Feb 4, 2020
Messages
4
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. Web
Link to Excel file: Diet (1).xlsx

I have a diet planner that I am trying to work with.
FOOD CATALOG sheet has all the macro information.
MEAL BUILDER sheet has the DATE, TIME, FOOD (from drop-down), and GRAMS eaten.
-Issue one: VLOOKUP is failing for random things. In the link, "Baby Potatoes" isn't being found in the FOOD CATALOG sheet, but it works if I just call it "Potatoes".
DAILY DIET sheet should add all info from the MEAL BUILDER sheet that has a matching date.
-Issue two: I've tried SUM with VLOOKUP and SUMIFS, but I haven't been able to get it to show more than one cell of data.

Any help is greatly appreciated!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
For Vlookup, can you check if they are same format? if they are, make sure you use absolute range for lookup array or use the whole column like =vlookup(D6,B:G,3,0) to get calorie

I would just go over the Sumif formula again to make sure you sum those correct. =sumif(range,criteria, sum_range) make sure to use absolute reference as well.
 
Upvote 0
Hi & welcome to MrExcel.
Can you please post the Vlookup formula that isn't working, along with what you have tried for issue 2
 
Upvote 0
Formula is F6 is
=VLOOKUP($D6,FoodCatalog,3)*$E6/100
1580913604537.png


Here is the FoodCatalog table
1580913674938.png


--
The strange thing is that if I change "Baby Potatoes" to "Potatoes", it works. The FOOD column (D) on MEAL BUILDER uses Data Validation from the FOOD column (B) on FOOD CATALOG.
1580913835999.png

1580913857744.png
 

Attachments

  • 1580913571113.png
    1580913571113.png
    28.6 KB · Views: 1
Upvote 0
The Vlookup should be
=VLOOKUP($D6,FoodCatalog,3,0)*$E6/100
Otherwise you are doing an approximate match, in which case the lookup table must be sorted A-Z
 
Upvote 0
Thank you, Fluff! That fixed the Meal Builder portion.

The SUMIF that I last tried was
=SUMIF(MealBuilder,[@DATE],MealBuilder[@GRAMS])
First row is correct, but the second row doesn't.
1580936640085.png

The number should be 470 for 2/4/2020
1580936228302.png
 

Attachments

  • 1580936124839.png
    1580936124839.png
    40.4 KB · Views: 1
Upvote 0
Ok, that formula should be
=SUMIF(MealBuilder[DATE],[@DATE],MealBuilder[GRAMS])
 
Upvote 0

Forum statistics

Threads
1,214,897
Messages
6,122,141
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top