+ Reply to Thread
Results 1 to 4 of 4

Find, sum and return value from 2nd spreadsheet

Hybrid View

  1. #1
    Registered User
    Join Date
    11-20-2006
    Posts
    1

    Find, sum and return value from 2nd spreadsheet

    Hi,

    I'm an excel newbie so hopefully someone will be able to help! I have a 2 spreadsheets where:

    Spreadsheet "Employee Info" has in each row:
    Column A lists: Employee Names
    Column D lists the employee's: Store Name
    Column I will eventually list the employee's: Sales YTD 2006

    The second spreadsheet is called "data" and lists in each row

    Column A: employee's name
    Column D: the employee's store name
    Column F: date of sale
    Column G: dollar value of the sale.

    The problem is that in "data" each employee can be listed multiple times as they may have multiple sales and that sales values from year 2005 are also included.

    I'm trying to build a macro that:

    1. Takes the employee's name and store name from "Employee Info"
    2. Finds all rows in "data" that matches the same employee's name and store name
    3. Sums the employee's sales but ONLY for sales completed in year 2006
    4. Takes that sum and inputs it into column C in "Employee Info"

    I've tried posting this elsewhere but didn't get very far; the vb code in the attached spreadsheet doesn't work....can anyone help?

    Much appreciated!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    you can do that without a macro, just putting a sumproduct formula in your employee info sheet to gather the data from the data sheet, This assumes you know the emplyee names and can input them into the employee info sheet.

    Of course, if you want to create the list of employees automatically as new employees are added, a macro will do just fine.

    Which way do you want to go?
    not a professional, just trying to assist.....

  3. #3
    Registered User
    Join Date
    11-19-2006
    Posts
    15

    Question

    Is that 2 seperate workbooks (spreadsheets) or 2 worksheets within the same workbook (Spreadsheet)

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Jade
    Hi,

    I'm an excel newbie so hopefully someone will be able to help! I have a 2 spreadsheets where:

    Spreadsheet "Employee Info" has in each row:
    Column A lists: Employee Names
    Column D lists the employee's: Store Name
    Column I will eventually list the employee's: Sales YTD 2006

    The second spreadsheet is called "data" and lists in each row

    Column A: employee's name
    Column D: the employee's store name
    Column F: date of sale
    Column G: dollar value of the sale.

    The problem is that in "data" each employee can be listed multiple times as they may have multiple sales and that sales values from year 2005 are also included.

    I'm trying to build a macro that:

    1. Takes the employee's name and store name from "Employee Info"
    2. Finds all rows in "data" that matches the same employee's name and store name
    3. Sums the employee's sales but ONLY for sales completed in year 2006
    4. Takes that sum and inputs it into column C in "Employee Info"

    I've tried posting this elsewhere but didn't get very far; the vb code in the attached spreadsheet doesn't work....can anyone help?

    Much appreciated!
    Hi,


    =SUMPRODUCT(--(data!A$2:A$31=A6)*(--(data!D$2:D$31=D6)*(--(LEFT(data!F$2:F$31,4)="2006")*(data!G$2:G$31))))

    but with CSE (CTRL/Shift/Enter) will extract the figures, as per the attached

    note, I have not checked your macro, but one name, Saunders,Debbi, was missing from the Employee Info sheet

    hth
    ---
    Attached Files Attached Files
    Last edited by Bryan Hessey; 11-20-2006 at 02:59 AM.
    Si fractum non sit, noli id reficere.

+ 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