+ Reply to Thread
Results 1 to 7 of 7

Auto Populate values if it meets condition

  1. #1
    Registered User
    Join Date
    07-25-2018
    Location
    NA
    MS-Off Ver
    NA
    Posts
    4

    Auto Populate values if it meets condition

    Hi,

    I have a table which has cost values for every product, But in another worksheet, I want excel to only populate list of products that cost more than $30. How do I do that? Can it be done by writing formulas?

    Example:
    Product (column A) Price (Column B)
    A $40
    B $60
    C $20
    D $10
    E $82
    F $5
    G $93
    H $35


    I want the result as:
    Product (column A) Price (Column B)
    A $40
    B $60
    E $82
    G $93
    H $35

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Auto Populate values if it meets condition

    Welcome to the forum!

    We ask for your location and your Office version for a good reason: firstly, where you are located will determine the locale used on your machine, and this, in turn, will affect the advice you are given, so please give us a rough idea (e.g. UK, USA, India, Europe, etc.), and secondly your Office version is important as some functions may not be available to you, and this also affects the advice given. Please go back to your user profile and fill these important details in. Thanks!
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Auto Populate values if it meets condition

    Hello and welcome to the forum. There are multiple ways that this can be done. Here are two:

    Formulas:

    A2 =IFERROR(INDEX(Sheet1!A:A,SMALL(IF(Table2[Price]>30,ROW(Table2[Price])),ROWS($1:1))),"") Ctrl Shift Enter
    Dragged over to B2 then down as far as needed.

    Power Query:
    Select A1:B9 > Data > From Table > Select the Price drop down > Number Filters > Greater Than > 30 > OK > Close & Load

    See attachment for both options.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-25-2018
    Location
    NA
    MS-Off Ver
    NA
    Posts
    4

    Re: Auto Populate values if it meets condition

    Thank you so much! Both worked! Owe you a lot!

    I would like to understand the formula. Could you please help me with it?

    Thanks.

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Auto Populate values if it meets condition

    You're welcome. Happy to help.

    I would like to understand the formula. Could you please help me with it?
    Sure. {=IFERROR(INDEX(Sheet1!A:A,SMALL(IF(Table2[Price]>30,ROW(Table2[Price])),ROWS($1:1))),"")}

    This is a typical way to return multiple matches. Let's work from the inside out.

    ROWS($1:1) = 1 so the SMALL function will return the 1st row # where the Price > 30 which is row 2. The INDEX function then returns the value that is in the 2nd row of column A.

    As the formula is dragged down, ROWS($1:1) changes to ROWS($1:2) which would return 2 and thus return the 2nd row # where the Price > 30.

    And so on.

    When you drag the formula to the right, everything stays the same except INDEX(A:A changes to INDEX(B:B so the column to be returned shifts from Product to Price.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  6. #6
    Registered User
    Join Date
    07-25-2018
    Location
    NA
    MS-Off Ver
    NA
    Posts
    4

    Re: Auto Populate values if it meets condition

    Quote Originally Posted by 63falcondude View Post
    You're welcome. Happy to help.


    Sure. {=IFERROR(INDEX(Sheet1!A:A,SMALL(IF(Table2[Price]>30,ROW(Table2[Price])),ROWS($1:1))),"")}

    This is a typical way to return multiple matches. Let's work from the inside out.

    ROWS($1:1) = 1 so the SMALL function will return the 1st row # where the Price > 30 which is row 2. The INDEX function then returns the value that is in the 2nd row of column A.

    As the formula is dragged down, ROWS($1:1) changes to ROWS($1:2) which would return 2 and thus return the 2nd row # where the Price > 30.

    And so on.

    When you drag the formula to the right, everything stays the same except INDEX(A:A changes to INDEX(B:B so the column to be returned shifts from Product to Price.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Thank you so much!

  7. #7
    Registered User
    Join Date
    07-25-2018
    Location
    NA
    MS-Off Ver
    NA
    Posts
    4

    Re: Auto Populate values if it meets condition

    Quote Originally Posted by 63falcondude View Post
    Hello and welcome to the forum. There are multiple ways that this can be done. Here are two:

    Formulas:

    A2 =IFERROR(INDEX(Sheet1!A:A,SMALL(IF(Table2[Price]>30,ROW(Table2[Price])),ROWS($1:1))),"") Ctrl Shift Enter
    Dragged over to B2 then down as far as needed.

    Power Query:
    Select A1:B9 > Data > From Table > Select the Price drop down > Number Filters > Greater Than > 30 > OK > Close & Load

    See attachment for both options.

    Hi,

    While the question I asked was only one part of the stuff I am doing on my excel sheet, it also has too many other data columns. I also have multiple pivots and formulas that make my dashoard. It's ~47 MB at the moment, and there's no problem, but the moment I added the array formula, it extremely slowed down my dashboard (like I am not exaggerating, but simply inserting one column in the sheet takes upto 4 minutes). When I delete the table with array formula (there are two columns in this table, one column has array formula, and the other column yields values corresponding to array formula results using vlookup), the excel sheet is back to normal.

    I cannot use power query, but is there any other way? like a VBA code?

+ 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] Sum top 30 highest values if meets condition
    By beeko in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-07-2017, 11:28 AM
  2. How to use VBA Code to auto populate with condition in specific sheet
    By ray.kanata in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2015, 03:24 PM
  3. How to auto populate from one sheet to another IF a condition is met?
    By zenkoan in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-08-2013, 04:31 PM
  4. Replies: 3
    Last Post: 02-28-2012, 11:54 AM
  5. Auto populate values
    By Windigo in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 08-17-2011, 06:13 PM
  6. Macro - auto populate the values based on previous cell values
    By Avinash Kumar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2009, 02:02 AM
  7. auto populate a cell using IF statement with multiple condition
    By njoymirror in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-30-2009, 03:21 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