# Add an Argument to this SUMIFS function

Hi Experts:

How would I modify this SUMIFS Function to subtract fields in "HisDataSUM" in which the values in column C were equal to the values in column D?

SUMIFS(HisDataSum!\$A:\$A,HisDataSum!\$B:\$B,IF(D13="All","<>0",D13),HisDataSum!\$C:\$C,IF(D14="All","<>0",D14),HisDataSum!\$E:\$E,IF(D16="All","<>0",D16) - X,

Using all the same criteria for cells D13, D14, and D16 X needs to Sum the values in HisDataSum column A only in the instances where the values in column C = column D.

If there is an easier way to do this; such as forget about the subtraction and only sum if column C <> column D that will work as well!

LVL 1
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
In order to use SUMIFS (and whole column references), you would need to add a helper column which flags when column C is equal to column C.... for example =IF(C2=D2,"Match","Not Matched")

e.g.

SUMIFS(HisDataSum!\$A:\$A,HisDataSum!\$B:\$B,IF(D13="All","<>0",D13),HisDataSum!\$C:\$C,IF(D14="All","<>0",D14),HisDataSum!\$E:\$E,IF(D16="All","<>0",D16,HisDataSum!\$X:\$X,"<>Match")

where X:X is flag column used...

Otherwise, you would need to use SUMPRODUCT and limit range sizes.
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
Flag column created, and it works, not the most elegant, but certainly better than limiting range sizes!
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.