Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 399
  • Last Modified:

Sumif Function where "criteria" refers to the contents of a cell.

In case of the Sumif function has a following structure SUMIF(range, criteria, [sum_range]). "Criteria" in this case is a condition or expression like "summer" or ">10" etc.

In my application I could have categories like
apple
pear
grape
orange
and I want to sum each of the categories, but I do not want to fill in each of the criteria in seperate sumif functions. I want to paste the Sumif function next to each category in this list and the "criteria" in the formula must refer to the category next to it, instead of being hard coded.

Is there a way to do it?

I hope some clever dude will understand my question.
0
Fritz Paul
Asked:
Fritz Paul
1 Solution
 
Rgonzo1971Commented:
Hi,

You can make a reference to another cell see example

=SUMIF(A1:A2,E1,B1:B2)

Open in new window



Regards
sumif.xlsx
0
 
Fritz PaulAuthor Commented:
of course.

I somehow just could not get it right.

Thanks a lot.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now