+ Reply to Thread
Results 1 to 8 of 8

Incrementing cell horizontally, sheet number vertically.

  1. #1
    Registered User
    Join Date
    09-30-2016
    Location
    Sussex, England
    MS-Off Ver
    Version 15.26
    Posts
    4

    Incrementing cell horizontally, sheet number vertically.

    Hello,

    I've been trying to work this out for a while.

    I've got a spreadsheet with all staff's individual hours which I use to calculate accrued holiday etc. We also have a timesheet spreadsheet which is filled in on a weekly basis. This one sheet contains all staff hours for that week. I have automated everything except for entering the staffs hours.

    I would like to be able to copy each weekly 'timesheet' sheet into a sheet on my individual employee hours spreadsheet (I don't want to import the data directly)

    Then be able to use a formula to correspond to the person's hours on the timesheet into their individual sheet and be able to drag the formula across and down, incrementing the cell number horizontally and sheet number vertically on each of our employee named sheets.

    This would mean, instead of spending ages doing the data entry, I can just drag the formula down each week.

    So it would be:

    First weekly timesheet data in Sheet1 cells B2 - B6
    Second weekly timesheet data in Sheet2 cells B2 - B6

    'Bobs' sheet

    First Week: =Sheet1!B2 =Sheet1!B3 =Sheet1!B4(..)
    Second Week: =Sheet2!B2 =Sheet2!B3 =Sheet2!B4(..)

    I have found a workaround using =INDIRECT("Sheet" & ROW(A1) & "!B25") and changing the cell value manually and dragging down. The problem is the rows on the initial timesheet also change around a lot, so 'Bob's' hours could be on row 7 one week and then row 8 the next week so I also need to be able to search for the name in the column and then use that row reference in the formula, possibly using an IF statement?

    I am not sure if this is actually possible but would really appreciate any help given (even if it is just to say that)!

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Incrementing cell horizontally, sheet number vertically.

    You haven't explained clearly where your data are. However is this the sort of thing you wanted?

    =VLOOKUP($A$1,INDIRECT("'Sheet"&ROWS($B$1:B2)&"'!A2:B5"),2,FALSE)
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    09-30-2016
    Location
    Sussex, England
    MS-Off Ver
    Version 15.26
    Posts
    4

    Re: Incrementing cell horizontally, sheet number vertically.

    Apologies,

    We have weekly timesheets with everyone's names listed on the left and then mon, tues, wed, thurs, fri as column headers with corresponding hours in the cells. This information will be in another sheet in the same document (as in the document you supplied).

    I also have tabs for each person which contain only their own weekly hours. I need the data from the weekly timesheet to be input into the corresponding week on their individual tab.

    So yes, sorry, I think you have interpreted me correctly!

    The formula you gave seems to do what I want in your document but I'm having trouble translating it for mine, do you mind explaining what the different parts are referring to so I can make sure I am changing the right values?

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Incrementing cell horizontally, sheet number vertically.

    It would help if you attached a sample Excel workbook, so we don't have to guess how your data is laid out, and we can supply you with a formula bespoke to your requirements.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Pete

  5. #5
    Registered User
    Join Date
    09-30-2016
    Location
    Sussex, England
    MS-Off Ver
    Version 15.26
    Posts
    4

    Re: Incrementing cell horizontally, sheet number vertically.

    OK this is the layout I'm working with:
    Attached Files Attached Files

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Incrementing cell horizontally, sheet number vertically.

    It's important that the names in A1 of the individual sheets are the same as those used on the weekly timesheets, so I put Bob, Tom and Mary in cells A2:A4 of sheets 1 to 3, then you can use this formula in E2 of the individual sheets:

    =IFERROR(VLOOKUP($A$1,INDIRECT("'Sheet"&ROWS($2:2)&"'!A2:F34"),COLUMNS($D:E),FALSE),"")

    Copy this across to I2, then you can copy those formulae down. Do the same for the other individual sheets.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    09-30-2016
    Location
    Sussex, England
    MS-Off Ver
    Version 15.26
    Posts
    4

    Re: Incrementing cell horizontally, sheet number vertically.

    It works perfectly if I start using the formula in E2.

    How can I modify it to work with people who have older hours in their file so e.g. Bob's already been working here for a year and has those hours on his file, so these new hours would be inputted further down the page in say E54?

    Thank you in advance!

    Edit: I worked it out, thank you so much for you help!
    Last edited by emmarald1; 09-30-2016 at 08:51 AM.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Incrementing cell horizontally, sheet number vertically.

    This is the part that determines which sheet number to get the data from:

    'Sheet"&ROWS($2:2)

    which basically evaluates to "Sheet1". When it is copied down, the ROWS part changes to ($2:3), then ($2:4), then ($2:5) on successive rows, so you should always ensure that the formula I gave you is put into the first cell (i.e. cell E54 on Bob's sheet), and then copied across and down from there.

    Hope this helps.

    Pete

    P.S. If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

+ 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. Copy formula horizontally- cell addresses should be vertically
    By Jan Zitniak in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-21-2016, 11:14 AM
  2. how to center excel sheet horizontally and vertically?
    By Arpita_Excel in forum Excel General
    Replies: 5
    Last Post: 06-08-2015, 11:30 PM
  3. [SOLVED] Returning values from another sheet which works when dragged horizontally and vertically
    By letstuffhappen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-06-2015, 01:22 PM
  4. Copy formulas horizontally while incrementing vertically
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2014, 08:08 AM
  5. [SOLVED] Look into a range of cells (horizontally and vertically) and return a number
    By sordid in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-23-2013, 07:06 AM
  6. UDF to Display Results Vertically Instead of One Cell Horizontally
    By snake10 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2008, 12:18 PM
  7. Replies: 2
    Last Post: 02-14-2005, 01:48 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