+ Reply to Thread
Results 1 to 7 of 7

Non-adjusting References in Formulas

  1. #1
    Registered User
    Join Date
    10-21-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    27

    Non-adjusting References in Formulas

    I have a monthly report that requires me to get the sum of consectuve months. For e.g. For the month of Feb, I would need to get the sum of Jan + Feb. There would be a macro in the file that helps me to add a new column after column C. When the department column is added, it would cause my formula to go haywire and reference to the wrong column. Instead of $D7:$D49833, it would make a reference to $E7:$E49833. Also, instead of referencing to $G7:$G$49833, it willl make a reference to $H7:$H$49833.

    I need the formulas to not adjust and stay as what it is given below when the macro adds a new column. How can this be done?


    My formula is as such: =SUMPRODUCT(IFERROR(('Detail by cc'!$A$7:$A$49833="CFS(SG)")*('Detail by cc'!$C$7:$C$49833="Enhancement")*IFERROR('Detail by cc'!$D$7:$D$49833=A17,0)*OFFSET('Detail by cc'!$G$7:$G$49833,0,0,,MONTH('ITSR Dashboard'!$B$1)),0))*1000

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Non-adjusting References in Formulas

    Maybe change from a direct reference $D7:$D49833 change to INDIRECT(D7:D49833)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Non-adjusting References in Formulas

    Hi,

    It seems to me that using a Named Range in your formula(s) might be what you are asking for. If the number of rows expands then a Dynamic Named Range would be useful. Read about them at:

    http://www.bettersolutions.com/excel...G820716330.htm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    10-21-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    27

    Re: Non-adjusting References in Formulas

    Hi Ford, I did as u advised but I got an error in my formula. How should I be changing this?
    =SUMPRODUCT(IFERROR(('Detail by cc'!$A$7:$A$49833="CFS(SG)")*('Detail by cc'!$C$7:$C$49833="Enhancement")*IFERROR('Detail by cc'!Indirect(D7:D49833=A17,0)*OFFSET('Detail by cc'!G7:G49833,0,0,,MONTH('ITSR Dashboard'!$B$1)),0))*1000

  5. #5
    Registered User
    Join Date
    10-21-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    27

    Re: Non-adjusting References in Formulas

    Hi Marvin, Im still not sure how it could be done...

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Non-adjusting References in Formulas

    May be:

    =SUMPRODUCT(IFERROR(('Detail by cc'!$A$7:$A$49833="CFS(SG)")*('Detail by cc'!$C$7:$C$49833="Enhancement")*IFERROR(INDIRECT("Detail by cc'!$D$7:$D$49833")=A17,0)*OFFSET('Detail by cc'!$G$7:$G$49833,0,0,,MONTH('ITSR Dashboard'!$B$1)),0))*1000
    Quang PT

  7. #7
    Registered User
    Join Date
    10-21-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    27

    Re: Non-adjusting References in Formulas

    Hi Quang PT,

    the value returns as "-" after trying to input what you suggested in the formula bar. It is unable to give me a value. Also, I would need the same to be done for the G7:G49833 part too.

+ 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. how to stop auto adjusting formulas when insert reference column
    By mystockpick in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-01-2014, 11:47 PM
  2. How to for converting absolute references to relative references in formulas
    By edspyhill01 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-11-2014, 02:09 AM
  3. [SOLVED] prevent Excel from adjusting formulas when inserting new columns of raw data
    By fmxwannabe in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-12-2013, 03:13 AM
  4. Replies: 7
    Last Post: 08-19-2012, 03:40 PM
  5. deleting a worksheet and auto adjusting formulas
    By bobbak in forum Excel General
    Replies: 6
    Last Post: 09-11-2009, 11:23 AM
  6. Replies: 3
    Last Post: 02-13-2008, 06:28 PM
  7. automatically adjusting formulas on filtering
    By markwilest in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-15-2007, 09:59 AM

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