+ Reply to Thread
Results 1 to 9 of 9

Return another cell if one cell equals another with formula

  1. #1
    Registered User
    Join Date
    01-29-2021
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    93

    Return another cell if one cell equals another with formula

    Hi all,
    this my 2nd time in this forum and really had a very good help and experience 1st time Thank you Fluff13.
    I have a question about dragging down formula. when i drag formula it change row numbers but i want same formula for every line.
    i want to make I5:N5 equal another value entered in A5:F5 , for any row and column i drag.
    Sample attached. Thank you
    screenshot.5811.jpg
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Return another cell if one cell equals another with formula

    Not really sure what you are expecting here?

    If you want the bolded parts to stay the same when copied across, but to change when copied down...
    =IF(A5=1,A1,IF(A5=2,B1,IF(A5...etc=3,C1,IF(A5=4,D1,IF(A5=5,E1,IF(A5=6,F1,"Error"))))))
    then try this....
    =IF($A5=1,A1,IF($A5=2,B1,IF($A5=3,C1,IF($A5=4,D1,IF($A5=5,E1,IF($A5=6,F1,"Error"))))))

    If that wasnt it, plz add some expected outcomes.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,171

    Re: Return another cell if one cell equals another with formula

    Try

    =IFERROR(INDEX($A$1:$F$1,,A5),"")

    Copy across and down

    I assume the result is a matrix of values in the first row
    Attached Files Attached Files
    Last edited by JohnTopley; 03-06-2021 at 07:38 AM.

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

    Re: Return another cell if one cell equals another with formula

    Not clear what is actually required.
    Try this.
    In I5 then copied across

    =IFERROR(AGGREGATE(15,6,$A$1:$F$1/(A5=$A$5:$F$5),1),"")
    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
    Registered User
    Join Date
    01-29-2021
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    93

    Re: Return another cell if one cell equals another with formula

    Quote Originally Posted by JohnTopley View Post
    Try

    =IFERROR(INDEX($A$1:$F$1,,A5),"")

    Copy across and down

    I assume the result is a matrix of values in the first row
    Thank you so much , your solution and kvsrinivasamurthy both works what I needed. Many thanks again

  6. #6
    Registered User
    Join Date
    01-29-2021
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    93

    Re: Return another cell if one cell equals another with formula

    Quote Originally Posted by kvsrinivasamurthy View Post
    Not clear what is actually required.
    Try this.
    In I5 then copied across

    =IFERROR(AGGREGATE(15,6,$A$1:$F$1/(A5=$A$5:$F$5),1),"")
    Very very nice, now i have 2 methods and all working well. that was very nice of yo u. thank you

  7. #7
    Registered User
    Join Date
    01-29-2021
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    93

    Re: Return another cell if one cell equals another with formula

    sorry still cant figure out when I have more than 6 numbers to check,
    I copied the code to my worksheet, just changed rows A1:F1 to O11:T11 and needed to check for 49 numbers instant of 6
    Can you please take a look at this attachment , row 22, O22:T22 Please?
    Attached Files Attached Files
    Last edited by Excl3454; 03-06-2021 at 01:17 PM.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,171

    Re: Return another cell if one cell equals another with formula

    The problem is that we originally thought the values were limited to those in row 22

    I changed formula in O23 to use INDEX formula,

    See attached.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-29-2021
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    93

    Re: Return another cell if one cell equals another with formula

    Quote Originally Posted by JohnTopley View Post
    The problem is that we originally thought the values were limited to those in row 22

    I changed formula in O23 to use INDEX formula,

    See attached.
    Thank you so much John, very nice and realty appropriate it.

+ 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] If a cell in a column equals today's date return the value of another cell adjacent to it
    By DeanExcel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-24-2021, 01:38 AM
  2. [SOLVED] if cell equals value then return answer
    By swfarm in forum Excel General
    Replies: 4
    Last Post: 07-02-2018, 06:56 AM
  3. [SOLVED] Return entire row if cell equals
    By Moedeb27 in forum Excel General
    Replies: 5
    Last Post: 08-03-2016, 07:28 PM
  4. [SOLVED] if a cell value in a range equals another cell, then return a value left of a cell
    By pasqualebaldi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-07-2015, 02:29 PM
  5. [SOLVED] IF 1 cell equals a range of others, return this cell
    By PDBartlett in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-06-2014, 07:38 AM
  6. if cell equals value then return previous cell address
    By gammaman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2014, 11:03 AM
  7. An equals formula that doesn't return a blank cell
    By stanja in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-30-2009, 03:37 PM

Tags for this Thread

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