Excel -how to add rows depending on criteria in original row

June 12, 2014 at 11:23:10
Specs: Windows 7
I have a very large set of data with employee names, salary details and some of the employees have a group number (each employee has one row). The group number represents 4 things: Cost Centre, Function, Account and FTE percentage. Groups can represent up to 8 rows of data because the Cost Center is split in 8. I would need to manipulate the original report to produce the details of each group. e.g. group 1000 has 8 rows.

My rudimentory knowledge of Excel would be to have a macro to add the correct number of rows necessary depending on the group #, then doing a Index, Match function to fill them.
Any suggestions to guide me would be very appreciated. thanks


See More: Excel -how to add rows depending on criteria in original row

Report •


#1
June 12, 2014 at 12:04:38
There are certain items that are not clear to me at this point:

"The group number represents 4 things: Cost Centre, Function, Account and FTE percentage. Groups can represent up to 8 rows of data because the Cost Center is split in 8."

If the group number represent 4 things, including the Cost Centre, and the "Cost Centre is split in 8", doesn't that mean 11 rows?

(Cost Centre x 8) + Function + Account + FTE percentage = 11

"doing a Index, Match function to fill them"

What are you filling them with that requires Index/Match? Should we assume that a simple Copy/Paste of the existing employee data into the new rows is not sufficient?

"add the correct number of rows necessary depending on the group #"

We will need a lot more detail before any code can be offered. We would need to know the layout of your spreadsheet, such as where these Group #'s reside, how many rows are associated with each Group #, etc. There are a couple of options that you can use to provide this detail.

Note: Prior to providing sample data, please ensure that any confidential or Personally Identifiable Information is altered/removed.

1 - You can post an example of the data in this forum - after clicking on the blue line at the end of this post and reading the instructions on how to format example data so that it is easier for us to read.

2 - You can post an example of the spreadsheet data on a website and then provide a link here in the forum

3 - You can email a copy of the workbook to a member of this forum if requested and allowable.

Since macros have to be written to be specific to the data they will be operating on, a lot of detail as to the spreadsheet lay out is required.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •
Related Solutions


Ask Question