+ Reply to Thread
Results 1 to 4 of 4

sumproduct - reading a variable value

Hybrid View

  1. #1
    Registered User
    Join Date
    03-17-2006
    MS-Off Ver
    2007
    Posts
    93

    sumproduct - reading a variable value

    Need help on this one, not a lot of time to try to learn it on my own:


    I have a list of employees in column A

    I have list of various job codes in column C with assigned employee number associated with that job code in column D,

    in range of row 5 through 960.



    I need the formula to read the employee number in A1,
    then search for that employee number in D5:D960,
    then count the number of specific job codes in the associated column C5:C960


    Employee 7004 did xx number of TC, SC, NC, DM, etc.



    Similar to this formula, but the “7004” is a variable that needs to be read from a cell rather be an absolute, and the “TC” needs to read that and about 10 more codes


    =SUMPRODUCT(($D$5:$D$960={"7004"})*($C$5:$C$960= "TC"))



    thanks for saving me, again….

    j
    Better to be roughly right than exactly wrong, unless you are using Excel.

  2. #2
    Bob Phillips
    Guest

    Re: sumproduct - reading a variable value

    Isn't it just

    =COUNTIF($D$5:$D$960,A1)

    --
    HTH

    Bob Phillips

    (replace xxxx in email address with googlemail if mailing direct)

    "redneck joe" <redneck.joe.28bkmm_1148487001.5102@excelforum-nospam.com>
    wrote in message
    news:redneck.joe.28bkmm_1148487001.5102@excelforum-nospam.com...
    >
    > Need help on this one, not a lot of time to try to learn it on my own:
    >
    >
    > I have a list of employees in column A
    >
    > I have list of various job codes in column C with assigned employee
    > number associated with that job code in column D,
    >
    > in range of row 5 through 960.
    >
    >
    >
    > I need the formula to read the employee number in A1,
    > then search for that employee number in D5:D960,
    > then count the number of specific job codes in the associated column
    > C5:C960
    >
    >
    > Employee 7004 did xx number of TC, SC, NC, DM, etc.
    >
    >
    >
    > Similar to this formula, but the "7004" is a variable that needs to be
    > read from a cell rather be an absolute, and the "TC" needs to read that
    > and about 10 more codes
    >
    >
    > =SUMPRODUCT(($D$5:$D$960={"7004"})*($C$5:$C$960= "TC"))
    >
    >
    >
    > thanks for saving me, again..
    >
    > j
    >
    >
    > --
    > redneck joe
    >
    >
    > ------------------------------------------------------------------------
    > redneck joe's Profile:

    http://www.excelforum.com/member.php...o&userid=32570
    > View this thread: http://www.excelforum.com/showthread...hreadid=545148
    >




  3. #3
    Miguel Zapico
    Guest

    RE: sumproduct - reading a variable value

    This one is bit ugly, but it can work for multiple job codes:
    =SUMPRODUCT(--($D$5:$D$960=$A$1),--(($C$5:$C$960= "TC")+($C$5:$C$960= "SC")))
    Adding more pieces of $C$5:$C$960="XX" will add those rows to the count.

    Hope this helps,
    Miguel.

    "redneck joe" wrote:

    >
    > Need help on this one, not a lot of time to try to learn it on my own:
    >
    >
    > I have a list of employees in column A
    >
    > I have list of various job codes in column C with assigned employee
    > number associated with that job code in column D,
    >
    > in range of row 5 through 960.
    >
    >
    >
    > I need the formula to read the employee number in A1,
    > then search for that employee number in D5:D960,
    > then count the number of specific job codes in the associated column
    > C5:C960
    >
    >
    > Employee 7004 did xx number of TC, SC, NC, DM, etc.
    >
    >
    >
    > Similar to this formula, but the “7004” is a variable that needs to be
    > read from a cell rather be an absolute, and the “TC” needs to read that
    > and about 10 more codes
    >
    >
    > =SUMPRODUCT(($D$5:$D$960={"7004"})*($C$5:$C$960= "TC"))
    >
    >
    >
    > thanks for saving me, again….
    >
    > j
    >
    >
    > --
    > redneck joe
    >
    >
    > ------------------------------------------------------------------------
    > redneck joe's Profile: http://www.excelforum.com/member.php...o&userid=32570
    > View this thread: http://www.excelforum.com/showthread...hreadid=545148
    >
    >


  4. #4
    Registered User
    Join Date
    03-17-2006
    MS-Off Ver
    2007
    Posts
    93
    ugly is as ugly does. Both seem to be working.


    Bob - I actually needed that one too, although slightly different reason.


    all beautiful to me.

    Thanks guys

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1