+ Reply to Thread
Results 1 to 5 of 5

Help needed on R1C1 formula reference

  1. #1
    Registered User
    Join Date
    01-14-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    45

    Help needed on R1C1 formula reference

    Hi all,

    I run a macro like like this on screenshot attached below:
    Please Login or Register  to view this content.
    but the column reference for the SUM part became XED and XEE.
    Capture.PNG

    I then autofilled it across the row, and in the immediate next column the column reference of the first reference in became C[0] (instead of C[29]), as shown in attachment below.

    Capture2.PNG

    Essentially what I am trying to do is, if the date is less than 30 days from the start date, sum cell-to-the-left and cell-below, if date is larger than 30 days then sum cell-below and the 29 cells to the left of it. Then autofill the row until a certain point (I have sorted the autofill bit out). I imagine this shouldn't be difficult but somehow I just can't make it work with a macro.

    Any help much appreciated, please let me know if there is further information I need to provide. Thank you very much in advance.
    Last edited by chococ; 02-18-2014 at 09:08 AM.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Help needed on R1C1 formula reference

    Please attach a workbook - screenshots are no good to work from.

    Please make clear what your required outcome is - enter the right formula manually, if necessary, so we can see what we're trying to achieve with code, and in which range.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    01-14-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Help needed on R1C1 formula reference

    Hello OllyXLS,

    Thank you very much for the response, I have attached a test workbook below. The blank void in the middle is normally filled with data but I have removed them since it's irrelevant to the macro concerned and involves sensitive business data.

    TestWorkbook1.xls

    Information:
    Orange rows = variable values drawn from another source

    Row 27 and row 29 are the desired outcome of the macro, except D27 and D29.

    Cell D27 and D29 (highlighted in yellow): I ran macro on these two cells, resulting in the undesired referencing

    Row 32 is a dummy row I put in to illustrate when I want the formula in row 27 and 29 to change.


    Hope these help, please let me know if there is any more information I could provide with. Thank you very much for your time and patience.

    EDIT:
    What I am trying to do is: a macro that can populate cell D27 and D29 with an IF formula that I can autofill across the row till the last cell with data in row 1--I have got the autofill part sorted. At the moment if I drag formula in D27 (generated from macro) across it will give REF! when going into the 31st day.
    Last edited by chococ; 02-18-2014 at 07:42 AM.

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Help needed on R1C1 formula reference

    try:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-14-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Help needed on R1C1 formula reference

    Thanks a lot, you're a star!! It works perfectly.

    Also thanks for reminding me that sometimes not everything needs to be written in macro

+ 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] Formula R1C1 reference a column
    By Journeyman3000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-13-2014, 08:39 PM
  2. Using Range Name reference as part of R1C1 Formula
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-14-2012, 01:32 PM
  3. Use Match or Lookup to create dynamic cell reference in VBA R1C1 formula
    By rmunsun1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-20-2012, 06:10 AM
  4. absolute cell reference in R1C1 reference style
    By Prorocentrum in forum Excel General
    Replies: 1
    Last Post: 06-18-2007, 04:59 PM
  5. [SOLVED] R1C1 reference
    By Tony S in forum Excel General
    Replies: 1
    Last Post: 05-10-2005, 01:06 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