+ Reply to Thread
Results 1 to 10 of 10

Match data from range to different range size, use adjacent cell of smaller range of data

  1. #1
    Registered User
    Join Date
    05-18-2016
    Location
    Verona, WI
    MS-Off Ver
    Office 2013
    Posts
    6

    Match data from range to different range size, use adjacent cell of smaller range of data

    Hi all,

    I'm trying to create a student loan calculator in Excel(google sheets) where I can add additional payments but it would only add it for a specific date not every single payment. I've used the formula: =if(day(A27)=Day($B$5),$B$6,"") where A27 is date, B5 is my scheduled monthly payment date, B6 is payment amount. This works for changing my scheduled monthly payment to a specified day of the month throughout the sheet, but what I want to do is allow 20 rows for additional payment dates,

    For example B10:B30 (any date for additional payment) C10:C30 (amount of additional payment). A31:A1000 (date in 1 day increments, starts at 1/1/2016, 1/2/2016, etc) D31:D1000 (Additional payment amount). I want to enter 1/2/2016 into B10, $30 into C10 and then $30 is pops into D32. Then enter 1/5/2016 into B11, $40 into C11, then $40 pops up into D35.

    Any thoughts? Any help would be greatly appreciated.

    Best,

    Robert

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,394

    Re: Match data from range to different range size, use adjacent cell of smaller range of d

    As shown in the attachment, put this formula in D30 and copy it down to D1000:

    =IFERROR(INDEX(C$10:C$30,MATCH(A31,B$10:B$30,0)),"")


    (Look in B10 - B30, and find the date that matches A31. If there is a match, copy the value in Col C to D31. If there is no match, Col D cell is blank.)

    Does the same for each row ("$" sets the Col B dates and Col C values as "Absolute" ranges)

    Ochimus
    Attached Files Attached Files
    Last edited by Ochimus; 05-18-2016 at 07:54 PM.

  3. #3
    Registered User
    Join Date
    05-18-2016
    Location
    Verona, WI
    MS-Off Ver
    Office 2013
    Posts
    6

    Re: Match data from range to different range size, use adjacent cell of smaller range of d

    Thanks!! That worked.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Match data from range to different range size, use adjacent cell of smaller range of d

    Here's another one...

    =IFERROR(VLOOKUP(A31,B$10:C$30,2,0),"")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    05-18-2016
    Location
    Verona, WI
    MS-Off Ver
    Office 2013
    Posts
    6

    Re: Match data from range to different range size, use adjacent cell of smaller range of d

    Would either of these formulas or something similar work for multiple columns? For example dates from B10:B30 and E10:E30 and H10:H30, pulling data from adjacent cells C10:C30 and F10:F30 and I10:I30 respectively to match A31:A1000 dates.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Match data from range to different range size, use adjacent cell of smaller range of d

    Not sure I follow you.

    Can you post a SMALL sample file and show us what results you expect.

    We don't need all of this: A31:A1000 dates.

    Just a few will do.

  7. #7
    Registered User
    Join Date
    05-18-2016
    Location
    Verona, WI
    MS-Off Ver
    Office 2013
    Posts
    6

    Re: Match data from range to different range size, use adjacent cell of smaller range of d

    I added an sample to "manage attachments". Is this the correct place to upload the spreadsheet?
    Attached Files Attached Files

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Match data from range to different range size, use adjacent cell of smaller range of d

    I downloaded your file but I'm completely lost.

    Tell us what to do with it.

  9. #9
    Registered User
    Join Date
    05-18-2016
    Location
    Verona, WI
    MS-Off Ver
    Office 2013
    Posts
    6

    Re: Match data from range to different range size, use adjacent cell of smaller range of d

    Alright, B8:B12,D8:D12 is where I would like to add dates for additional payments. I want the information in C8:C12,E8:E12 (corresponding to B8:B12,D8:D12) to pull into respective cells G14:G19 based on dates in A14:A19.

    For example, if I make an additional payment on 4/22/2016 of $10.50. I want cell G15 to be $10.50. Also if I type 5/22/2016 into D11 and $13.00 into E11, I would like cell G18 to be $13.00.

    A couple of my formulas are off since I just copied a small sample of my original sheet but ultimately my goal is what was previously described.

    Thanks for your help!

  10. #10
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,394

    Re: Match data from range to different range size, use adjacent cell of smaller range of d

    If you want to do that, you need to switch to "SUMiF".

    As you can see in the updated attachment, I have added your two extra "blocks" of possible dates and sums into Cols E and F, and H and I.

    Cell B31 now has this somewhat longer formula, copied down to B1000:

    =IF(SUMIF(B$10:B$29,A31,C$10:C$29)+SUMIF(E$10:E$29,A31,F$10:F$29)+SUMIF(H$10:H$29,A31,I$10:I$29)=0,"",SUMIF(B$10:B$29,A31,C$10:C$29)+SUMIF(E$10:E$29,A31,F$10:F$29)+SUMIF(H$10:H$29,A31,I$10:I$29))

    (Add up everything in C10 - C29 where the date in B10 - 29 matches A31, Then add to that subtotal everything in F10 - F29 where the date in E10 - 29 matches A31, Then add to that subtotal everything in I10 - I29 where the date in H10 - 29 matches A31. If there is no match in any of the three blocs. the cell remains empty)

    As before, the "$" signs in each bloc set the range as "absolute", otherwise the range you are searching would drop one row as you moved down Col A.

    You should also consider "naming" the six bloc ranges, as it makes things much easier to follow.

    Ochimus
    Attached Files Attached Files
    Last edited by Ochimus; 05-19-2016 at 06:56 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. make excel file smaller by constraining the data range
    By eac13 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-06-2015, 03:12 PM
  2. VBA Code to grab data give critiria in textbox and output data range to cell range. Help!?
    By exclusiveicon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-26-2014, 05:31 PM
  3. range find data and write to adjacent cell
    By cdy3900 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2013, 11:32 PM
  4. Match values in a range with another range and copy the adjacent column
    By xelmac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2012, 01:42 PM
  5. Replies: 4
    Last Post: 01-27-2012, 09:50 AM
  6. Populate a range of vertical data based on the value in an adjacent cell?
    By juniperjacobs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-19-2010, 12:14 PM
  7. Range selection based on adjacent cell range
    By iguss in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-20-2008, 07:57 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