+ Reply to Thread
Results 1 to 7 of 7

autopopulate formula from two columns of data

  1. #1
    Forum Contributor
    Join Date
    08-19-2012
    Location
    Tacoma, Washingtonn
    MS-Off Ver
    Excel 2019
    Posts
    254

    autopopulate formula from two columns of data

    greetings all,

    I am hoping someone can provide a relatively novice user a simple formula. My project is:

    In excel 2010, I have 2 columns (A & B). A data has already been entered, and is a list of all groceries. B column is blank until I enter the price next to the grocery I purchase. I would like to create another sheet I will call results, and would like it to autopopulate only columns A & B that have the price entered in column B, without listing the entire grocery list of items.

    The grocery list thing is just an analogy, but I could really use some help. thanks...

    Jim

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,731

    Re: autopopulate formula from two columns of data

    try this in cell D2
    =INDEX($A$2:$A$11, SMALL(IF(($B$2:$B$11>0), MATCH(ROW($B$2:$B$11), ROW($B$2:$B$11))), ROW(A1)), COLUMN(A1))
    and then in the next column to get the price
    =VLOOKUP(D2,$A$2:$B$11,2,FALSE)

    see attached
    Attached Files Attached Files
    Last edited by etaf; 03-08-2013 at 05:41 PM.

  3. #3
    Forum Contributor
    Join Date
    08-19-2012
    Location
    Tacoma, Washingtonn
    MS-Off Ver
    Excel 2019
    Posts
    254

    Re: autopopulate formula from two columns of data

    If I have sent this several times, I apologize...I'm new. The formula works however is there a way to make the #NUM! go away? Can that just return a blank cell?

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,731

    Re: autopopulate formula from two columns of data

    =IF(ISERR(INDEX($A$2:$A$11, SMALL(IF(($B$2:$B$11>0), MATCH(ROW($B$2:$B$11), ROW($B$2:$B$11))), ROW(A1)), COLUMN(A1))),"",INDEX($A$2:$A$11, SMALL(IF(($B$2:$B$11>0), MATCH(ROW($B$2:$B$11), ROW($B$2:$B$11))), ROW(A1)), COLUMN(A1)))
    and
    =IF(D2="","",VLOOKUP(D2,$A$2:$B$11,2,FALSE))

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: autopopulate formula from two columns of data

    Is this what you are looking for?
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  6. #6
    Forum Contributor
    Join Date
    08-19-2012
    Location
    Tacoma, Washingtonn
    MS-Off Ver
    Excel 2019
    Posts
    254

    Re: autopopulate formula from two columns of data

    Copy3 of AMC 2013 budget.xls

    Thank you for your help. I thought I would be smart enough to adapt a working formula to my actual project, but I can't. I have attached a copy of my actual project. As you can see, tab 1 is "Budget" and tab 2 is "JAN-Report".

    I am trying to populate the fields in JAN-Report (A14:A17) for description, and along with the correspondig amount in (F14:F17) for the amount. All of this is taken from Budget C6:C16 (for JAN). When an amount is entered into the C column it will automatically fill in JAN-Report with description and amount. Then I should be able to adapt it to the expense columns. I just need a start!

    Thanks again...

    Jim

  7. #7
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,731

    Re: autopopulate formula from two columns of data

    C6:C16 does not match the number of rows in A14:A17 - so if you happen to have all rows complete with no blanks - that maybe an issue - so you may need a macro that inserts rows (not my expertise)
    using Jacc formula

    if you put in Jan report sheet cell A14
    =IFERROR(INDEX(Budget!$A$6:$A$16,SMALL(IF(Budget!$C$6:$C$16<>"",ROW(Budget!$C$6:$C$16)-ROW($A$5)),ROWS($B$6:B6))),"-")
    and use control+shift+enter {}
    BUT i dont think you can put array formulas in merged cells - at least I cant in start2010

    see attached - need to put an errorcondition for a 0 in the formula - is this what you are after ?
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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