+ Reply to Thread
Results 1 to 3 of 3

Can anyone explain in laymans terms what the R1C1 Formulas are actually doing?

  1. #1
    Registered User
    Join Date
    01-31-2015
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    91

    Can anyone explain in laymans terms what the R1C1 Formulas are actually doing?

    Windows 10
    Excel 2019

    Can anyone explain in lay terms what the R1C1 formulas are doing, preferably in standard Excel terms (non R1C1)

    I have a workbook with two worksheets and the below VBA code pulls selected data from one worksheet "Track Data2" into the second.

    It is pulling from 7 columns but I now need to add a further 3.

    Rather than ask for the code I want to learn what the below code is doing so I can do it myself.

    Please remember that R1C1 is completely out of my knowledge.

    I have searched extensively on google, this forum and on Microsofts knowledge base but nothing
    explains what these formulas are actually doing.

    Thanks in advance



    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Can anyone explain in laymans terms what the R1C1 Formulas are actually doing?

    I don't know what consititutes layman's terms, but here's how R1C1 references work.

    R means rows, C means columns.

    When the R1C1 option is selected in Excel options, row and column headers are both numbers. Rows are numbered from 1 to 1E6 from top to bottom. Columns are numbered 1 to 16000 from left to right (for most of us who are used to reading from left to right. In locales/languages where one is used to reading from right to left, it's backwards).

    Numbers after R or C represent absolute references. R1C1 is an absolute reference to row #1, column #1, or cell $A$1 in A1 notation.

    Numbers in brackets [] after R or C represent relative references. R[-1]C[-1] is a reference to the cell 1 row above and 1 column to the left of the cell containing the reference. You have to know which cell contains the reference in order to translate into A1 notation. Note that [0] means same row/column, and is usually omitted. R[0]C[-1] and RC[-1] mean the same thing (same row, 1 column to the left).

    Mixed use of brackets/no brackets yields mixed absolute/relative references. RC4 refers the cell in column 4 (column D) of the same row. R3C[5] refers to the cell in row 3 of the column 5 columns to the right.

    The formulas being entered by the code then mean:
    in B2: "=IF(RC[-1]="""","""",'Track Data'!RC)" If the cell in the same row and one column to the left (A2) is null string (or blank), return null string, else return the value from "Track Data" same row and column (B2). Note that, if we made the first reference a mixed reference ($A2 or RC1), C2 is simply a copy of this formula.

    In D2: "=IF(RC[-3]="""","""",'Track Data'!RC[2])" If the cell in the same row and 3 columns to the left (A2 again, or, looking at the other formulas, perhaps more appropriate RC1 or $A2 again) is null string, return null string, else return the value from "Track Data" in the same row and 2 columns to the right (F2). Again, if we made the IF(test) a mixed reference to always reference column 1/A, E2:H2 are just copies of D2.

    At this point, I will observe that the main advantage to R1C1 notation when using VBA to write formulas is that the formula text doesn't change when we copy/paste/fill formulas in R1C1 notation. In A1 notation, of course, the formula text changes. The formula in B2, =IF(A2="""","""",'Track Data'!B2), when copied into B3, changes to =IF(A3="""","""",'Track Data'!B3). In R1C1 notation, however, the formula in B3 looks exactly like the formula in B2. =IF(RC[-1]="""","""",'Track Data'!RC). With the added observation that the IF tests are always referencing column A, we can replace all of that VBA code with 2 VBA statements:

    Please Login or Register  to view this content.
    I'm not sure exactly how you want to "add extra columns," but hopefully that help you see how these formulas work so you can figure out how to add more columns.
    Last edited by MrShorty; 03-22-2024 at 10:59 AM.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

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

    Re: Can anyone explain in laymans terms what the R1C1 Formulas are actually doing?

    R1C1 formulas refer to a style of referencing cells in a spreadsheet

    "R" stands for "row," and "C" stands for "column."
    So, R1C1 means "Row 1, Column 1."
    Each cell in a spreadsheet can be identified by its row number and column letter (or vice versa).
    For example, R3C2 refers to Row 3, Column 2.
    It's a different way of describing cell locations compared to the more common A1 style, where cells are referenced by their column letter and row number (like A1, B2, C3, etc.).
    Quang PT

+ 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. Please Explain in Lamen's Terms
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 07:05 AM
  2. [SOLVED] Please Explain in Lamen's Terms
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  3. [SOLVED] Please Explain in Lamen's Terms
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  4. [SOLVED] Please Explain in Lamen's Terms
    By Karen in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. Please Explain in Lamen's Terms
    By Karen in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  6. Please Explain in Lamen's Terms
    By Karen in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. [SOLVED] Please Explain in Lamen's Terms
    By Karen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-16-2005, 04:05 PM
  8. Can anyone explain the -- in layman's terms?
    By Celt in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-02-2005, 03:25 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