Sum Values Based On A Cell Value From A Different Column

eddmike

New Member
Joined
Jun 30, 2022
Messages
1
Office Version
  1. 2021
Platform
  1. Windows
Hi,

I am facing an issue making a grocery list that changes its cost according to what I purchase In an exact day.

Here's a mini sheet I created to see what I mean

Example: Column C reflects my Monday purchases

I want to put the letter X on things I wanted to buy, Apple C3, Water C6 and Batteries C8, and I want that total cost of these to be reflected in C1, from Column B which has the Price of each of them

I tried to use Index Match, Vlookup and some Countif/s .. Nothing worked. I know it easy but Its kinda keep slipping from me
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
sumif()

In C1 and copy to d1, e1 etc
=SUMIF(C3:C11,"X",$B$3:$B$11)

result in C1, D1 etc

Grocery List.xlsx
ABCDEFGHIJ
1Daily Cost >>1622.527.529.52013.550
2ItemPriceMondayTuesdayWednesdayThursdayFridaySaturdaySunday
3Apple1XX
4Orange2.5XXX
5Eggs6XX
6Water5XXXXX
7Diet Coke5XX
8Batteries 10XXX
9Breakfast15XXXX
10Launch25X
11Coffee7.5X
12
Sheet1
Cell Formulas
RangeFormula
C1:I1C1=SUMIF(C3:C11,"X",$B$3:$B$11)
 
Upvote 0
Solution
you may not want this - But you could just put a quantity in

so if you had 6 eggs as an X - then a 1 - would be 6 - but if you put 2 , then that would be 12
same as coke, if you purchased packs etc

anyway - if you wanted to
sumproduct()

would look like this

Grocery List.xlsx
ABCDEFGHI
1Daily Cost >>212204029.54099.550
2ItemPriceMondayTuesdayWednesdayThursdayFridaySaturdaySunday
3Apple111
4Orange2.5413
5Eggs6112
6Water522124
7Diet Coke562
8Batteries 10121
9Breakfast1512111
10Launch251
11Coffee7.52
Sheet1
Cell Formulas
RangeFormula
C1:I1C1=SUMPRODUCT($B$3:$B$11,C3:C11)
 
Upvote 0

Forum statistics

Threads
1,215,053
Messages
6,122,882
Members
449,097
Latest member
dbomb1414

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