+ Reply to Thread
Results 1 to 8 of 8

Efficient data sourcing from other worksheets.

  1. #1
    Registered User
    Join Date
    07-16-2014
    Location
    montreal, canada
    MS-Off Ver
    2016
    Posts
    39

    Efficient data sourcing from other worksheets.

    Hello all! Hope you are all doing well!

    I am trying to source data from 10 worksheets. The data I am checking is the date on a specific cell of each worksheet and comparing it to today's date.

    I have the following formula working:

    =SI(DATE(ANNEE(Marlon!D4);MOIS(Marlon!D4);JOUR(Marlon!D4))=DATE(ANNEE(Sommaire!Y7);MOIS(Sommaire!Y7);JOUR(Sommaire!Y7));1;0)

    The problem is that this method is highly inefficient because I have 32 such specific cells per worksheet and the 10 worksheets to pull from. I had previously finished expanding the formula over cells for the first worksheet (Marlon) and wanted to directly copy what i had filled out into the cells next to it. The problem is that no matter what i did excel kept changing the formula. And even at that i would still have to go back and change the name of the worksheet that the formula is referring to another 864 times.

    To lay out exactly what i am doing:
    I have 10 identical worksheets. I want to check the date on 32 specific cells of each worksheet (the sheets are identical so it is always the same cell on each worksheet that i am referring to) I have the page organized into two macro columns such that the cells i am interested in are at D4 and K4. And both columns repeat downward 16 times such that the next cells i am interested in are D14 and K14. (the next set is D24 and K24).

    I am then comparing the retrieved date to a cell that has today's date on it and checking to see if the dates are the same. If they are return one. If not return zero.

    Is there a more efficient way to do this?
    Thanks for all your help!

    Dom

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Efficient data sourcing from other worksheets.

    Why not

    =--(Marlon!D4 = Sommaire!Y7)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    07-16-2014
    Location
    montreal, canada
    MS-Off Ver
    2016
    Posts
    39

    Re: Efficient data sourcing from other worksheets.

    what is that? an operator or a function?

    it seems to work but it still doesn't solve the problem of how i copy the formula, though it is much faster to write.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Efficient data sourcing from other worksheets.

    The "--" causes the true/false result to be converted to a 1/0 result.

    Hard to say without seeing an example of your workbook (go advanced>Manage attachments)

    If for example you have
    =--(Marlon!D14 = Sommaire!K14) in one row (Let's say cell B2) and directly below it you want
    =--(Marlon!D24 = Sommaire!K24)
    =--(Marlon!D34 = Sommaire!K34)
    and so on,
    in B2 copied down
    =--(OFFSET(Marlon!$D$14, (ROWS($A$1:$A1)-1)*10,0)=OFFSET(Sommaire!$K$14, (ROWS($A$1:$A1)-1)*10,0))
    Hope that helps

  5. #5
    Registered User
    Join Date
    07-16-2014
    Location
    montreal, canada
    MS-Off Ver
    2016
    Posts
    39

    Re: Efficient data sourcing from other worksheets.

    That is fine for copying the rows down but what about copying along columns where i need to change the referenced worksheet?
    for example, Column B2 and C2 refer to Marlon!D#4 and Marlon!K#4 respectively, but now column D2 and E2 need to refer to Michael!D#4 and Michael!K#4?
    Also, is there a way to have the portion of the formula that refers to Sommaire!Y7 always be Sommaire!Y7 when i copy it? There is a simple workaround for that* but i was just wondering if it is possible.

    *The simple workaround being that i copy Sommaire!Y7 down a column to Y8, Y9, etc, it being just a reference to today's date.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Efficient data sourcing from other worksheets.

    Also, is there a way to have the portion of the formula that refers to Sommaire!Y7 always be Sommaire!Y7 when i copy it?
    Yes, the $ is used as an anchor so if you put a $ in front of the row (i.e. Y$7), then when you copy between rows, it will stay at 7. When you put a $ in front of the column ($Y7), it will lock the column in place. You want both so $Y$7.

    You can use INDIRECT. Again, I cannot see exactly what you are working with but I attached an example of how that might work. Your example would be a little more complex with two indirects in each cell.
    Put the appropriate sheet names in row 2, this is the formula in B3 copied across and down
    =INDIRECT(B$2&"!D"&(4+(ROWS($A$1:$A1)-1)*10))

    Note, that when I got to sheet "One More" it didn't work. That's because when the sheet name has spaces, we need to enclose it in single quotes 'One More'
    so I changed the formula to

    =INDIRECT("'"&F$2&"'!D"&(4+(ROWS($A$1:$A1)-1)*10))
    Hope that helps.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-16-2014
    Location
    montreal, canada
    MS-Off Ver
    2016
    Posts
    39

    Re: Efficient data sourcing from other worksheets.

    That first suggestion in the last comment works perfectly!!! All my worksheets have no spaces so i don't need to worry about that though!

    Thank you so much for all your help! You obviously had a reasonable understanding of what i need! Also thank you for the thing about $ being an anchor I didn't know the symbol meant that. (i'm used to $ being at the beginning of variables in coding to create it)

    You are a genius!
    Have a great weekend!

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Efficient data sourcing from other worksheets.

    Glad I could help.

+ 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] Sourcing data from a table of information.
    By Behlen in forum Excel General
    Replies: 9
    Last Post: 01-08-2014, 05:55 PM
  2. [SOLVED] More efficient way to search for data and split into worksheets?
    By virgincinboy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-29-2013, 08:33 AM
  3. Sourcing Data in Line Chart
    By rhudgins in forum Excel General
    Replies: 17
    Last Post: 09-21-2010, 03:25 PM
  4. Sourcing data in Charts
    By rhudgins in forum Excel General
    Replies: 3
    Last Post: 07-19-2010, 05:21 PM
  5. Sourcing data from 15 other spreadsheets
    By djmetsandy in forum Excel General
    Replies: 3
    Last Post: 09-29-2009, 04:37 PM

Tags for this Thread

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