# Excel SumProduct or Macro Solution Help

Hello,

Hoping someone can assist.  Please see attached sample.  I'd like a formula or macro that could the following 2 tasks:
1.  Based on the position selected in the Developers tab (cell B3) the code would match the position on the Open Position Date tab, and pull the appropriate number of positions in column J and place them in column F on the Developer tab.  For example, if Quarterback is selected, the code would return a 3 in column F since there are 3 Quarterback positions identifed in the other tab.

2.  The code would also subtract the numbers in column J and column K (in the Open Position Date tab) to provide the number of filled positions in column G in the Developers tab.

Any assistance in putting this together would be greatly appreciated.

Thanks!
EE-Sample.xlsx
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:
For 1 you can use a SUMIF formula, e.g. in F3

=SUMIF('Open Position Data'!G:G,B3,'Open Position Data'!J:J)

When I used that I got result 2 not 3 because "Quarterback" is misspelt in Open Position Data cell G5, so you need to correct that to get 3 as required

How do you define Total positions filled, is that just j minus K, if so then you can use two SUMIFs, e.g.

=SUMIF('Open Position Data'!G:G,B3,'Open Position Data'!J:J)-SUMIF('Open Position Data'!G:G,B3,'Open Position Data'!K:K)

or SUMPRODUCT like this

=SUMPRODUCT(('Open Position Data'!G:G=B3)+0,'Open Position Data'!J:J-'Open Position Data'!K:K)

regards, barry
0

Experts Exchange Solution brought to you by