+ Reply to Thread
Results 1 to 6 of 6

building a table based on an other table

  1. #1
    Registered User
    Join Date
    10-02-2013
    Location
    Mississauga, Ontario
    MS-Off Ver
    Office 365 Version 1909 (Build 12026.20264)
    Posts
    12

    building a table based on an other table

    I have a table (Table-1) which contains two columns. Column -1 has a date and Column-2 has an amount. Column-1 is in date sequence but can have multiple entries for the same date.
    I want to build another table (Table-2) where Column-1 is already populated with a date. This table is in date sequence and has no duplicate dates.
    I will like to populate the amount (Column-2) in all rows of Table-2 from Column-2 of the last, or the only, Column-1 matching row of Table-1 (i.e. same date in Column-1 of both Table-1 and Table-2).
    Can I do this without VB? Any help will be appreciated.

    Capture.GIF


    Note that Table-1 does not have an entry for Jan-4 and In Table-2 the Amount is therefore duplicated from Jan-3
    Last edited by qjawaid; 09-19-2019 at 07:37 PM.

  2. #2
    Registered User
    Join Date
    06-21-2017
    Location
    Missouri, USA
    MS-Off Ver
    2007 through 2019
    Posts
    71

    Re: building a table based on an other table

    This should work in G2
    =IFERROR(INDEX($D$2:$D$7,SUMPRODUCT(MAX(ROW($C$2:$C$7)*(F2=$C$2:$C$7))-1)),G1)
    Drag down to fill below. You'll want to change the 7's to wherever the end of your real list is...
    * Edited - Sorry, I had the wrong columns
    Last edited by SjMaxwell; 09-20-2019 at 12:01 AM.

  3. #3
    Registered User
    Join Date
    10-02-2013
    Location
    Mississauga, Ontario
    MS-Off Ver
    Office 365 Version 1909 (Build 12026.20264)
    Posts
    12

    Re: building a table based on an other table

    I tried but getting incorrect values. Most likely I have made in error in editing the formula to change column numbers. Please have a look.

    It is Col-P starting in Row-4 that I am trying to populate from values in Col-I after matching the dates in Col-K and F. So I changed the formula as follows:

    Orginal Formula: IFERROR(INDEX($D$2:$D$7 , SUMPRODUCT(MAX(ROW($C$2:$C$7 ) * F2=$C$2:$C$7 ))-1)),G1)
    Edited Formula:- IFERROR(INDEX($I$4:$I$700,SUMPRODUCT(MAX(ROW($B$4:$B$700)*(K4=$F$4:$F$700))-1)),p3)

    As you can see, the Colum-P value for Sep 4 is incorrect.

    Capture2.GIF
    Last edited by qjawaid; 09-20-2019 at 03:14 AM.

  4. #4
    Registered User
    Join Date
    06-21-2017
    Location
    Missouri, USA
    MS-Off Ver
    2007 through 2019
    Posts
    71

    Re: building a table based on an other table

    Enter this in P4
    =IFERROR(INDEX($I$4:$I$700,SUMPRODUCT(MAX(ROW($F$4:$F$700)*(K4=$F$4:$F$700))-1)),p3)

    If it doesn't work you might need to upload an example spreadsheet.

  5. #5
    Registered User
    Join Date
    06-21-2017
    Location
    Missouri, USA
    MS-Off Ver
    2007 through 2019
    Posts
    71

    Re: building a table based on an other table

    Change the -1 to -3
    I built the formula starting in row 2, but you're starting in 4!
    Sorry. Let me know if that works out

  6. #6
    Registered User
    Join Date
    10-02-2013
    Location
    Mississauga, Ontario
    MS-Off Ver
    Office 365 Version 1909 (Build 12026.20264)
    Posts
    12

    Re: building a table based on an other table

    Great! It works now. Thanks very much.

    Edit to document another solution I found:

    =IF(ISNA(LOOKUP(2,1/(F$4:F$700=K4),I$4:I$700)),L3,(LOOKUP(2,1/(F$4:F$700=K4),I$4:I$700)))

    In this case it is Col-L, rather than Col-P, that is the target.
    Last edited by qjawaid; 09-20-2019 at 09:51 AM.

+ 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. Replies: 1
    Last Post: 03-25-2018, 04:16 PM
  2. [SOLVED] Building a table based on a smaller one
    By AnnaDana in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2013, 02:49 PM
  3. Replies: 1
    Last Post: 02-03-2013, 09:05 AM
  4. Building a table automatically based on data from another sheet (vlookup?)
    By HyperG in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-20-2012, 11:34 PM
  5. Building a data table
    By jwongsf in forum Excel General
    Replies: 0
    Last Post: 03-09-2010, 11:19 AM
  6. Building table
    By Alf in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2006, 04:30 PM

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