+ Reply to Thread
Results 1 to 3 of 3

Set cell equal to variable cell (from set column) based on cells in adjacent column

Hybrid View

alter54 Set cell equal to variable... 01-22-2014, 02:50 PM
Pauleyb Re: Set cell equal to... 01-22-2014, 06:06 PM
alter54 Re: Set cell equal to... 01-24-2014, 01:04 PM
  1. #1
    Registered User
    Join Date
    08-14-2012
    Location
    Utah, United States
    MS-Off Ver
    Excel 2010
    Posts
    19

    Set cell equal to variable cell (from set column) based on cells in adjacent column

    I am trying to automate a process where the "Date of Last Payment" is identified from a loan amortization schedule. For example:

    The column coordinate will always come from the "Date" column (B); the row coordinate needs to be determined based on the "Balance" column (C) - the final row where cell value is greater than zero - in this case, row 13. Therefore, the "Date of Last Payment" will be "Oct-14" (C2 = B13).

    Screen Shot 2014-01-22 at 11.25.37 AM.png

    I am going to be analyzing large groups of amortization schedules and I want to populate a summary sheet with the "Date of Last Payment" with the press of a button. There are numerous other factors but this is the only piece I haven't been able to figure out because of the variability and column relationships.
    *Note that the "balance" column is a set of formulas.

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Set cell equal to variable cell (from set column) based on cells in adjacent column

    Try this:
    =INDEX(B5:B18,MATCH(0,C5:C18,0))
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Registered User
    Join Date
    08-14-2012
    Location
    Utah, United States
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Set cell equal to variable cell (from set column) based on cells in adjacent column

    This may not be the most efficient way to solve the issue but I did the following:

    Sub Macro2()
    '
    ' Macro2 Macro
    
        Range("H7").Select
      ' Identify last cell in column with value greater than $0  
        ActiveCell.FormulaR1C1 = _
            "=SMALL(R[4]C[-1]:R[363]C[-1],COUNTIF(R[4]C[-1]:R[363]C[-1],""<=0"")+1)"
      ' Lookup the date of last payment  
        Range("G7").Select
        ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[1],R[4]C:R[363]C[5],6,FALSE)"
      ' Copy/Paste Value to delete formula 
        ' I did this because I needed to be able to change inputs without impacting this date.  
        Range("G7").Select
        Selection.Copy
        Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=False
      ' Delete the vlookup formula
        ' I did this because it was no longer necessary after inputting new data  
        Range("H7").Select
        Application.CutCopyMode = False
        Selection.ClearContents
    
    End Sub
    The data included in the attached spreadsheet is incomplete but it is enough to illustrate how the task was accomplished. Let me know if there are any suggestions for improving it. Exploring Debt Calcs.xlsm

    Thanks to Pauleyb for the suggestion.

+ 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] count number of cells in Column C that have a lesser or equal value to the adjacent cell
    By Geoff Jones in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-18-2013, 11:01 AM
  2. [SOLVED] SUM cells with equal values in an adjacent column.
    By angelopc in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-13-2013, 09:55 AM
  3. Format cell based on adjacent cell / apply to column
    By mknispel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-07-2013, 11:29 AM
  4. Replies: 1
    Last Post: 03-02-2013, 05:06 AM
  5. Average range of cells in column if values in adjacent column are equal
    By RyNye in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-09-2012, 10:12 AM

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