+ Reply to Thread
Results 1 to 5 of 5

Extract a range based on a value

  1. #1
    Registered User
    Join Date
    06-14-2012
    Location
    IRAN
    MS-Off Ver
    Excel 2016
    Posts
    11

    Extract a range based on a value

    Hello everyone
    In sample file I have 2 range (green and yellow)
    In column A I have Power (kW) value(70 & 100)
    In the blue range I want to have a formula that displays the corresponding range by entering the amount of power in cell F2
    The correct answer for the value 70 is shown in the orange range.
    Thank you for your help
    Attached Files Attached Files
    Last edited by mvatan; 02-16-2021 at 10:25 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,067

    Re: Extract a range based on a value

    In I2, copied across and down:

    =IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$15)/($A$2:$A$15=$F$2),ROWS(I$2:I2))),"")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  3. #3
    Registered User
    Join Date
    06-14-2012
    Location
    IRAN
    MS-Off Ver
    Excel 2016
    Posts
    11

    Re: Extract a range based on a value

    Tank you
    but it isn't true
    In sample file I show Correct answer
    I need exactly like attached pic based on power value
    Attached Images Attached Images

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Extract a range based on a value

    ARRAY formula in I2 then copied across.

    =IFERROR(INDEX(INDEX(A$2:A$15,MATCH($F$2,$A$2:$A$15,0)-1):INDEX(A$2:A$15,MATCH(2,1/($A$2:$A$15=$F$2),1)),ROWS(I$2:I2)),"")

    To enter ARRAY formula
    Copy and paste the formula in cell
    Press F2
    Press Ctrl+Shift+Enter together
    Excel covers the formula with {}.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,067

    Re: Extract a range based on a value

    You're right! It was an incorrect answer.

    KVS's answer is rather clever... I like it! But if you prefer a non-array formula, you can use this:


    =IFERROR(INDEX(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$15)-1/($A$2:$A$15=$F$2),1)):INDEX(A:A,AGGREGATE(14,6,ROW($A$2:$A$15)/($A$2:$A$15=$F$2),1)),ROWS(I$2:I2)),"")

    in I2, copied across and down.
    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)

Similar Threads

  1. [SOLVED] Sumifs formula to extract values based on date range
    By Howardc1001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-23-2020, 02:17 AM
  2. [SOLVED] Macro to extract data based on date range and values
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 36
    Last Post: 05-08-2020, 10:44 AM
  3. [SOLVED] Extract data based on range of dates and value
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 03-04-2020, 10:29 PM
  4. [SOLVED] Extract range based on cell values
    By D_N_L in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-21-2014, 11:11 AM
  5. [SOLVED] extract the text based on the => number range
    By Pranesh84 in forum Excel General
    Replies: 7
    Last Post: 05-06-2014, 08:26 AM
  6. extract the text based on the => number range
    By Pranesh84 in forum Hello..Introduce yourself
    Replies: 0
    Last Post: 05-02-2014, 02:08 PM
  7. Need to extract a small range from a large one based on cell value
    By Ahmed Abodorra in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-17-2013, 09:20 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