+ Reply to Thread
Results 1 to 3 of 3

Drag formula down and change only certain values

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Drag formula down and change only certain values

    Hi smart peoples,
    I have the following formula and want to be able to drag it down and have it change the 'K17' to 'K18' (two locations within formula, shown in bold) and the 'WP1-0003' (two locations within formula, shown in bold) to '0004' and so on and so on through to '5000'... I want all other values within formula to remain the same..
    All/ any ideas/ suggestions appreciate.

    =IF(K17="green tag",'C:\Users\BUDJO\Desktop\WP1 Scaffold Gear List\[WP1-0003.xlsx]Gearlist'!$S$98,IF(K17="red tag",'C:\Users\BUDJO\Desktop\WP1 Scaffold Gear List\[WP1-0003.xlsx]Gearlist'!$S$98,""))
    Last edited by Jose Bug; 11-21-2020 at 07:01 PM. Reason: typo

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

    Re: Drag formula down and change only certain values

    You won't be able to do that using a formula.

    To change the 0003 to 0004 within the filename and have Excel recognise it as a valid cell reference, you would have to use the INDIRECT function (in conjunctions with ROWS() ). However, this only works on external files that are open in the same instance of Excel (in which case you would not need to include the full path), and as you want to go up 5000 I can't see you wanting to open 5000 files.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    08-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Drag formula down and change only certain values

    So by ripping apart the text string and then reassembling I was able to come up with the formulas I want:
    =IF(K17="green tag",'C:\Users\BUDJO\Desktop\WP1 Scaffold Gear List\[WP1-0003.xlsx]Gearlist'!$S$98,IF(K17="red tag",'C:\Users\BUDJO\Desktop\WP1 Scaffold Gear List\[WP1-0003.xlsx]Gearlist'!$S$98,""))
    =IF(K18="green tag",'C:\Users\BUDJO\Desktop\WP1 Scaffold Gear List\[WP1-0004.xlsx]Gearlist'!$S$98,IF(K18="red tag",'C:\Users\BUDJO\Desktop\WP1 Scaffold Gear List\[WP1-0004.xlsx]Gearlist'!$S$98,""))
    =IF(K19="green tag",'C:\Users\BUDJO\Desktop\WP1 Scaffold Gear List\[WP1-0005.xlsx]Gearlist'!$S$98,IF(K19="red tag",'C:\Users\BUDJO\Desktop\WP1 Scaffold Gear List\[WP1-0005.xlsx]Gearlist'!$S$98,""))
    =IF(K20="green tag",'C:\Users\BUDJO\Desktop\WP1 Scaffold Gear List\[WP1-0006.xlsx]Gearlist'!$S$98,IF(K20="red tag",'C:\Users\BUDJO\Desktop\WP1 Scaffold Gear List\[WP1-0006.xlsx]Gearlist'!$S$98,""))
    etc etc

    But for reasons beyond me it does not treat this as a formula..
    So I have copy pasted into notepad, then copy pasted back into relevant cells in excel.. seems to be working
    Last edited by Jose Bug; 11-21-2020 at 10:34 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: 1
    Last Post: 06-14-2017, 04:54 PM
  2. [SOLVED] How to change the drag down fill formula?
    By nova312 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-05-2017, 03:22 PM
  3. [SOLVED] I want my criteria to change when I drag a formula
    By ZMF in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 02-20-2014, 08:40 PM
  4. [SOLVED] Drag formula, change sheet
    By lamdl in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-03-2014, 01:26 AM
  5. [SOLVED] Change references as you drag formula down
    By jeffreybrown in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-15-2013, 11:37 PM
  6. Replies: 6
    Last Post: 07-16-2012, 12:05 PM
  7. How do I keep letters the same and change the # for drag formula
    By ASST in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-22-2006, 09:30 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