Populating a Cell Based Off of Two Columns Values

MDean3313

New Member
Joined
Jul 8, 2019
Messages
13
Hello again everyone,

I have two columns that I want to compare data and fill in a single cell with the SUM of one of those columns.

The first column is K. The cells are populated from K2:K59. There are 7 different values randomly listed in this column: Custom, Small Industrial, Lighting, SEM, Custom O&M, Prescriptive and Green Rewind. The second column, AT, has numerical values, also populated from AT2:AT259. I want to use a code that looks at column K to see which cells list "Custom." I want it to sum up the numerical values from column AT that correlate to "Custom" and sum up their values into a single cell.

I tried using this code to start:

=VLOOKUP(K2:K259,AT2:AT259,2,FALSE)

However, I feel as though I may need to use an IF and SUM statement to tell it to only look at the cells labeled "Custom" but am not sure how to format it.

If this doesn't make sense feel free to ask any questions.

Thanks everyone!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi,

Sounds like you just need SUMIF.

Use this with the criteria hard coded:

=SUMIF(K2:K259,"Custom",AT2:AT259)

Use this with a cell reference for the criteria, you can change A1 to whatever you want to SUM:

=SUMIF(K2:K259,A1,AT2:AT259)
 
Upvote 0
I didn't even think about using the SUMIF function.

Thank you so much, you made my life about 100 times easier.
 
Upvote 0
You're welcome, welcome to the forum, and thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,704
Messages
6,173,984
Members
452,540
Latest member
haasro02

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