+ Reply to Thread
Results 1 to 9 of 9

How to perform a range of functions only for when the values of column A are identical

  1. #1
    Registered User
    Join Date
    09-12-2015
    Location
    NYC
    MS-Off Ver
    Excel for Mac 2011
    Posts
    5

    How to perform a range of functions only for when the values of column A are identical

    Hi everyone,

    I'm working on a huge spreadsheet where I basically have to consolidate a lot of info. The spreadsheet contains info about the grants applied for by employees -- I've mocked up a simple example of what I'm dealing with and am attaching it here. Each row represents a different grant; the columns are the employee that applied for it, its proposed amount, its received amount (if this grant has been funded), the grant's status (Funded, Declined, Pending, or Withdrawn).

    The goal is to consolidate this info so that each row is a unique employee's name, with the info summarized in columns for each employee (TOTAL amount proposed by that employee, TOTAL amount received, total # of grants applied for, total # funded, total # declined, etc etc etc).

    For the last couple hours I've been doing this manually -- creating a new row for each employee, summing the total amounts proposed, summing the total amounts received, counting the total number of grants, counting the number of cells that read "Funding", then deleting all the other rows for that employee (the rows listing each individual grant)...

    Is there a way to automate this process, so that Excel will count the # of Status cells that say "Funded," "Declined," etc., and sum the total proposed and received amounts, for each employee -- that is, for each group of rows that contains the same unique Employee name in Column A?

    I would so appreciate any help!!

    Please downloaded Example2 to see the structure of the data I'm working with vs. what I want:
    Example2.xlsx
    Attached Files Attached Files
    Last edited by laurenf92; 09-12-2015 at 03:34 AM.

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: How to perform a range of functions only for when the values of column A are identical

    Try this - paste it in a module. It assumes that your rows start row 2, row 1 being a header and that the sheet with your date is in "Sheet1"

    Please Login or Register  to view this content.
    Worked fine on your example sets
    Last edited by JasperD; 09-12-2015 at 04:05 AM.
    Please click the * below if this helps

  3. #3
    Registered User
    Join Date
    09-12-2015
    Location
    NYC
    MS-Off Ver
    Excel for Mac 2011
    Posts
    5

    Re: How to perform a range of functions only for when the values of column A are identical

    Hi JasperD,

    I'm new to VBA, so I'm sorry if this is a silly question, but when I run it it just creates a new sheet with the header, and nothing else? Am I doing something wrong?

  4. #4
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: How to perform a range of functions only for when the values of column A are identical

    Hi Lauren,

    your sheet with data is probably not called 'sheet1'. Change this line to have the correct sheet name.
    Please note that the macro expects the data to be exactly like your sample sheet - so names in column A etc.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-12-2015
    Location
    NYC
    MS-Off Ver
    Excel for Mac 2011
    Posts
    5

    Re: How to perform a range of functions only for when the values of column A are identical

    Hi JasperD,

    Thanks so much for replying. My sheet was called "Sheet1," and everything is formatted exactly the same. I actually tried to run that macro in the example file I attached here and it did the same thing -- just made a new sheet with only the header filled in...any ideas?

  6. #6
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: How to perform a range of functions only for when the values of column A are identical

    Try the attached file. Works for me on Win7 / Excel 2013
    Example.xlsm

  7. #7
    Registered User
    Join Date
    09-12-2015
    Location
    NYC
    MS-Off Ver
    Excel for Mac 2011
    Posts
    5

    Re: How to perform a range of functions only for when the values of column A are identical

    I ran it on a Windows computer and it worked PERFECTLY! Thank you sooooo much! This is a life saver!

    There's another feature I'd like to add if it's not too hard to do. There's a column called Departments, and some employees have more than 1, which are listed in different rows for the same employee. Would there be a way to have Excel keep the department name for an employee if it's the same department name all the way down for that unique employee, but if there are multiple unique values for "Department" for the same employee, to have each new unique value put into the next column (labeled Second dept, Third dept, and so on)? And then to highlight the rows for each employee who has multiple departments? I'm attaching another visual example.

    Thanks so much for all your help!!!

    ExampleWithDepartments attached:
    ExampleWithDepartments.xlsx

  8. #8
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: How to perform a range of functions only for when the values of column A are identical

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-12-2015
    Location
    NYC
    MS-Off Ver
    Excel for Mac 2011
    Posts
    5

    Re: How to perform a range of functions only for when the values of column A are identical

    Thank you, thank you, thank you! You're a hero!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Find Values in Column A and fill identical values in Column B
    By deviltronics in forum Excel General
    Replies: 6
    Last Post: 10-07-2014, 05:25 PM
  2. Replies: 2
    Last Post: 03-12-2013, 04:10 PM
  3. Averaging values from rows with identical column
    By Broccoli in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-15-2012, 07:51 PM
  4. SMALL/LARGE Functions & Identical Values Issue
    By an_otter in forum Excel General
    Replies: 5
    Last Post: 03-15-2011, 06:29 PM
  5. Replies: 1
    Last Post: 10-07-2010, 07:51 PM
  6. Count number of identical values in a column
    By pjkcards in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2010, 09:44 AM
  7. Counting number of identical values (or text) in a range
    By Excelerate-nl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2005, 05:05 AM

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