+ Reply to Thread
Results 1 to 32 of 32

copy/paste or dragging cells using INDIRECT in formula

  1. #1
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    copy/paste or dragging cells using INDIRECT in formula

    so I have a formula...
    HTML Code: 
    that I would like to copy/paste in different areas of my spreadsheet.

    The only problem is the cell references stay the same when I do so. Any idea how to allow excel to automatically change these cell references?


    btw: I am finding an average of a column and skipping any values of zero. I need INDIRECT because the amount of cells that need averaged is constantly changing and I need to dynamically change the range size (S2).

    Thanks

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: copy/paste or dragging cells using INDIRECT in formula

    Can you attach a sample workbook with your formula in it? I copied and pasted your formula into a blank workbook and dragged it down and the cell reference (the only one I see in the formula is S2) changed as it should. I also copied and pasted and they changed.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    I am not sure that indirect is required. If you are concerned about the range of data you need to consider then either a named dynamic range will do, or an Excel table column.
    Here is information on dynamic ranges: http://www.utteraccess.com/wiki/inde...Dynamic_Ranges
    Here is information on Excel Tables: http://www.utteraccess.com/wiki/inde...ables_in_Excel

    As for getting an average but ignoring zeros, you can either use helper columns or an array formula: http://www.utteraccess.com/wiki/inde...inIf_AverageIf

  4. #4
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    Quote Originally Posted by gmr4evr1 View Post
    Can you attach a sample workbook with your formula in it? I copied and pasted your formula into a blank workbook and dragged it down and the cell reference (the only one I see in the formula is S2) changed as it should. I also copied and pasted and they changed.
    Book2.xlsx

    there is a small portion of the worksheet

    that snipit is of one NBA player. I need to do this for every NBA player (350+ players)

    here is a screenshot of the actual sheet zoomed way out for reference
    nba.PNG


    basically I need to copy and paste these formulas for every player

  5. #5
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    Quote Originally Posted by dflak View Post
    I am not sure that indirect is required. If you are concerned about the range of data you need to consider then either a named dynamic range will do, or an Excel table column.
    Here is information on dynamic ranges: http://www.utteraccess.com/wiki/inde...Dynamic_Ranges
    Here is information on Excel Tables: http://www.utteraccess.com/wiki/inde...ables_in_Excel

    As for getting an average but ignoring zeros, you can either use helper columns or an array formula: http://www.utteraccess.com/wiki/inde...inIf_AverageIf

    I tried using named dynamic ranges, but with 3+ ranges per player and 350+ players my named ranges would be out of control. Plus I dont know how easy that would be to copy/paste.

    I am currently using array formulas to ignore zero values when calculating values. see attached sheet in post above

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    Please attach a sample workbook.

  7. #7
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31
    Quote Originally Posted by dflak View Post
    Please attach a sample workbook.
    I did, it's two posts above

  8. #8
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    Is it not working correctly?

  9. #9
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: copy/paste or dragging cells using INDIRECT in formula

    What is this _xlfn.STDEV.P in your array formula? I remove it and it seems to work ok...I think.

  10. #10
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    Here is my attempt at it. I have one sheet. It has 12 ranges. Each of the ranges is local to the sheet it is on. If you copy the sheet, it will produce an identical set of ranges local to the new sheet.

    I also employed some helper cells to help set up the ranges. They depend upon counting the number of entries in column P so don't add any additional titling to this column.

    I left the name definitions on the page.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    Quote Originally Posted by gmr4evr1 View Post
    What is this _xlfn.STDEV.P in your array formula? I remove it and it seems to work ok...I think.
    The version I have just has the formulas as follows (for std deviation)

    Please Login or Register  to view this content.
    I dont know where the _xlfn portion is coming from???

  12. #12
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    Quote Originally Posted by dflak View Post
    Here is my attempt at it. I have one sheet. It has 12 ranges. Each of the ranges is local to the sheet it is on. If you copy the sheet, it will produce an identical set of ranges local to the new sheet.

    I also employed some helper cells to help set up the ranges. They depend upon counting the number of entries in column P so don't add any additional titling to this column.

    I left the name definitions on the page.
    I see what you did there. But where would I place all those helper cells when I am setting this up for every player in the NBA? Plus, I would need unique named ranges for each player as there are different game totals for each. One player might have played 38 games whereas another one might have only played 34.

  13. #13
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    Right click on the tab. You get a menu. One of the options on the menu is move or copy. Select this option and another dialog box comes up. Click on the box Create a copy and select where you want the copy to appear. Click OK.

    You now have a duplicate of that page including all formulas and named ranges. The named ranges are limited to the page itself. So if you have 350+ players you will have 350+ instances of each named range, each one of them pertaining to its own page.

    The named ranges are defined using the offset command. These ranges "know" how many rows of data there are in the data set. In other words, they know how many games a player has played.

    I thought of a entirely different approach to the issue. Instead of duplicating all this work 350 times. How about having just the data for a player on the page. Then on a dashboard sheet you have a dropdown by player (and if you want you can have two dropdowns: one for team which will get you a list of players on that team) and the other to select the specific player on the team. Somewhere on the spreadsheet, you'll need to identify teams and who is on each team.

    On the dashboard sheet, you select the player, and the stats will appear automatically. You will not have to navigate off-page except to update data fro the player.

    In fact, you could select a team, and the macro will present the players for that team across the columns with the stats in the rows and a team total at the end.

    Give me about 10 sheets of data for two teams and I can demonstrate this. Make sure you tell me who is on what team. I don't follow basketball at all and would be hard pressed to even name all the teams, much less know their rosters.

    This approach will cut down the number for formulas from the thousands into a couple dozen making the spreadsheet more responsive. Also it is easier to maintain. You don't have to set up formulas for every player. That will happen when his data is imported to the dashboard sheet.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  14. #14
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31
    Quote Originally Posted by dflak View Post
    Right click on the tab. You get a menu. One of the options on the menu is move or copy. Select this option and another dialog box comes up. Click on the box Create a copy and select where you want the copy to appear. Click OK.

    You now have a duplicate of that page including all formulas and named ranges. The named ranges are limited to the page itself. So if you have 350+ players you will have 350+ instances of each named range, each one of them pertaining to its own page.

    The named ranges are defined using the offset command. These ranges "know" how many rows of data there are in the data set. In other words, they know how many games a player has played.

    I thought of a entirely different approach to the issue. Instead of duplicating all this work 350 times. How about having just the data for a player on the page. Then on a dashboard sheet you have a dropdown by player (and if you want you can have two dropdowns: one for team which will get you a list of players on that team) and the other to select the specific player on the team. Somewhere on the spreadsheet, you'll need to identify teams and who is on each team.

    On the dashboard sheet, you select the player, and the stats will appear automatically. You will not have to navigate off-page except to update data fro the player.

    In fact, you could select a team, and the macro will present the players for that team across the columns with the stats in the rows and a team total at the end.

    Give me about 10 sheets of data for two teams and I can demonstrate this. Make sure you tell me who is on what team. I don't follow basketball at all and would be hard pressed to even name all the teams, much less know their rosters.

    This approach will cut down the number for formulas from the thousands into a couple dozen making the spreadsheet more responsive. Also it is easier to maintain. You don't have to set up formulas for every player. That will happen when his data is imported to the dashboard sheet.
    Interesting idea! Would the source data page be setup the same? (When I say source data page I am referring to the screen shot above). The reason I ask is, my import data macro is setup to take a .csv file (that I download after every days games) and imports them into that source data sheet. The .csv file is in no peticular player order and requires the macro to search out the players name and import the data below. If the appearance of that page changes, I would need to alter that macro.

  15. #15
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    I should also add that this data that is being calculated (std deviations & averages) all gets added into a table and is then sorted. I then use that table to come up with players who might have big games for any given day

  16. #16
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    What is the format of the CSV file and can you include a sample? I might be able to do you one better - the system I am proposing would work perfectly with one big flat file with all the player's data. No need for you to sort it, that will happen when you call for the player's stats. From a programming point, if it is a big flat file, it not only makes it easier, it gives you greater flexibility.

  17. #17
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    I will upload a sample later today when I get home from work.

  18. #18
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    Guru_Data.txt

    here is an example of the CSV file that I use for uploading each days data

    Obviously its in a TXT format. I import that data into a separate sheet within my workbook. My macro then takes that data, sorts, and adds it into the source data sheet.

  19. #19
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    This is gold, give me a day or two.

  20. #20
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    I just had a look at the source data.

    I need your help. You will have to explain how you manipulate the data from the CSV format to the format in the workbook. You mentioned something about a macro, but I didn't see it in the workbook (which is XLSX anyway).

  21. #21
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    Quote Originally Posted by dflak View Post
    I just had a look at the source data.

    I need your help. You will have to explain how you manipulate the data from the CSV format to the format in the workbook. You mentioned something about a macro, but I didn't see it in the workbook (which is XLSX anyway).
    I omitted the macro to keep the file size down.

    This is my process... (If there is an easier way to accomplish this task, I am all ears)

    1.)Download the TXT file from the website. Data in the TXT is comma separated values
    2.)Within excel, go to Get External Data -> From Text and point to the TXT file. Basically move the values from TXT file to blank sheet. The data is imported exactly in the same manner that it is setup in the TXT file.
    3.)Click on a command button that initiates a macro. This macro uses two arrays. One is loaded with all of the newly imported data, and another with the list of player names on the source data sheet (Screen shot above, A1:EBV1). The macro then loops through and compares the player names from both arrays. When it finds a match it then dumps the associated data into a new line below the players name on the source data sheet.

    That's basically it. That was the best idea I could come up with given my limited excel knowledge.

  22. #22
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    I got the data loaded and I got the concept of appending the data to the end of the existing data. What I need is a "mapping."

    How do I go from this:
    GID ESPN ID Pos Name Team Salary Salary Change Points GP Pts/Game Pts/G/$ Pts/G(alt) Last pts Days ago

    to this:
    FDP Salary H/A Score Mins Made Val? Upside? Dud?

  23. #23
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    I gotcha... I may have uploaded the wrong TXT file. This one is the one that I use for the daily data...

    jan8.txt

    the mapping is as follows...

    TXT FILE SOURCE DATA SHEET
    FD Points FDP
    FD Salary Salary
    H/A H/A
    Team Score Score
    Minutes Mins


    You can see how I derived the values for Made Val?, Upside?, and Dud? with the formulas in those cells.

    Sorry for the confusion

  24. #24
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    The only one of the Txt file headers I see is Salary I don't see FD Points, H/A, Team Score or minutes in the data.

    I don't think I do have the correct file.

  25. #25
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    check my last post, I attached a new TXT file.

    the header line should be as follows
    Date;GID;Pos;Name;Starter;FD Pts;FD Salary;Team;H/A;Oppt;Team Score;Oppt Score;Minutes;Stat line

  26. #26
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    Much better. I'm relatively new to the forum and keep looking for attachments at the end of the file.

  27. #27
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    I'm almost done with this ditty. One more question. I can arrange that if a player does not play on a given date, that that game doesn't show up at all in the calculations. Or the game shows up but we use the array formulas to calculate the statistics.

    For example, in the picture, the player did not play the first game. I can leave this as is and compensate in the formulas, or I can just show the games where minutes played > 0.

    Let me know which way you would like to go. Personally, I think it makes more sense to go with the latter because of the fofollowing: suppose a player plays 8 of the last 10 games.

    With the former logic, we look at the last 10 records and exclude the two games with zero metrics. So, the metric is based on 8 games. Likewise if a player misses the last three games, this metric goes out the window since we look at the last three records and they are all ignored.

    If we base the metrics only on games played, then the last 10 games is the last 10 games actually played which might be over the course of more than 10 days. In all cases the metric would be computed only on the games the player actually plays.

    Please confirm what you want to do.
    Attached Images Attached Images

  28. #28
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    I agree. I think it makes more sense to only show the games where the minutes played > 0. I want the stats to be calculated based on games that the player actually plays in.

  29. #29
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    Ok, here it is. I had to dummy up a lot of data to test the features. I passed the sheet on with this data included so you can play with it a bit.

    When you are ready to use the sheet “for real,” go to the Total Data tab, select Rows 2 to the end in Column A and right click. One of the options is Delete. When you click on that, select the option Table Rows. You are now good to go.

    When you do your first data import and add it to the history, you will get a message about the dates not being consecutive. This is a built in check. Ignore it for the very first import.

    The included instructions should tell you everything you need to know.

    I made extensive use of named ranges, pivot tables and Excel tables. Here is some more information on named ranges and Excel tables:

    http://www.utteraccess.com/wiki/inde...ables_in_Excel

    http://www.utteraccess.com/wiki/inde...Dynamic_Ranges
    Attached Files Attached Files

  30. #30
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: copy/paste or dragging cells using INDIRECT in formula

    As I was crafting my reply, I was adding features. I forgot to save the file when I attached it. So use this file instead.
    Attached Files Attached Files

  31. #31
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    Quote Originally Posted by dflak View Post
    As I was crafting my reply, I was adding features. I forgot to save the file when I attached it. So use this file instead.
    That is freaking fantastic!

    Those calculated statistics... (Averages & Std Deviations). Would it be possible to have those calculated for every player so that I can use a lookup function to send them to another table of all NBA players, so that I can sort them to see the highest and lowest?

  32. #32
    Registered User
    Join Date
    04-29-2015
    Location
    Ohio
    MS-Off Ver
    2013
    Posts
    31

    Re: copy/paste or dragging cells using INDIRECT in formula

    I also sent you the same PM prolly 4 times, so check your inbox
    Last edited by notoriusjt2; 02-10-2016 at 07:49 PM.

+ 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. Replies: 16
    Last Post: 09-29-2015, 01:06 AM
  2. Problems dragging down Indirect formula referring to a range
    By _hs_ in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-26-2013, 08:09 AM
  3. Replies: 2
    Last Post: 01-23-2013, 12:32 PM
  4. Dragging down Indirect Formula
    By MROMAR in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-22-2012, 10:33 AM
  5. Replies: 0
    Last Post: 03-09-2009, 05:16 AM
  6. [SOLVED] Copy/Paste how to avoid the copy of formula cells w/o calc values
    By Dennis in forum Excel General
    Replies: 10
    Last Post: 03-02-2006, 06:50 PM

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