+ Reply to Thread
Results 1 to 20 of 20

if cell range contains certain text then return value of corresponding cell

  1. #1
    Registered User
    Join Date
    10-18-2011
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    21

    if cell range contains certain text then return value of corresponding cell

    Hi
    Appreciate if someone could help me on the below part
    I have three columns A,B,C
    A1-Jack
    A2-Jill
    A3-Jack
    A4-Rose
    A5-Jack

    B1-Pass
    B2-Pass
    B3-Fail
    B4-Pass
    B5-Pass

    C1-Date1
    C2-Date2
    C3-Date3
    C4-Date4
    C5-Date5

    So my requirement is if A:A = Jack and B:B = Pass then it should return value as below column d
    D1-Date1
    D2-Date5

  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,036

    Re: if cell range contains certain text then return value of corresponding cell

    Try:

    =IFERROR(INDEX($C$1:$C$5,SMALL(IF($A$1:$A$5="Jack",IF($B$1:$B$5="Pass",ROW($A$1:$A$5))),ROWS(D$1:D1))),"")

    entered as an array formula. ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    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
    10-18-2011
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: if cell range contains certain text then return value of corresponding cell

    Thanks a lot Glenn.
    Almost there. But I am getting output as
    D1-Date1
    D2-Date1
    D3-Date1
    D4-Date1
    D5-Date1

    Instead of

    D1-Date1
    D2-Date5

    Thanks in advance

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: if cell range contains certain text then return value of corresponding cell

    Confirm the posted #2 formula with control+Shift+Enter not just enter
    Last edited by AliGW; 04-13-2017 at 07:08 AM. Reason: Unnecessary quotation removed.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Registered User
    Join Date
    10-18-2011
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: if cell range contains certain text then return value of corresponding cell

    yes indeed. I pasted formula with ctrl+shift+enter and then I got output as
    D1-Date1
    D2-Date1
    D3-Date1
    D4-Date1
    D5-Date1

    Instead of

    D1-Date1
    D2-Date5

  6. #6
    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,036

    Re: if cell range contains certain text then return value of corresponding cell

    Wrong way to do it. Copy paste and CTRL-SHIFT-ENTER in ONE cell and then copy down.

  7. #7
    Registered User
    Join Date
    10-18-2011
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: if cell range contains certain text then return value of corresponding cell

    wow. genius. Problem solved. Thanks a lot

  8. #8
    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,036

    Re: if cell range contains certain text then return value of corresponding cell

    You're welcome.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  9. #9
    Registered User
    Join Date
    10-18-2011
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: if cell range contains certain text then return value of corresponding cell

    Hi, when I change C1 or C2 or C3 or C4, D1 and D2 does not change. Is it like each time I need to press ctrl+shift+enter in D1 and then copy down?

  10. #10
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: if cell range contains certain text then return value of corresponding cell

    I think your calculation option is in manual mode change it to Automatic Mode

    Formula > Calculation Options >Automatic
    or can use pivot table simply
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  11. #11
    Registered User
    Join Date
    10-18-2011
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: if cell range contains certain text then return value of corresponding cell

    It is already in Automatic mode. Can't use pivot. setting up formulas to avoid pivot

  12. #12
    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,036

    Re: if cell range contains certain text then return value of corresponding cell

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  13. #13
    Registered User
    Join Date
    10-18-2011
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: if cell range contains certain text then return value of corresponding cell

    It contains full of Banking related confidential details. I will try to create one dummy and send. Thanks

  14. #14
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: if cell range contains certain text then return value of corresponding cell

    Attach sample excel file after removing the confidential dataa

  15. #15
    Registered User
    Join Date
    10-18-2011
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: if cell range contains certain text then return value of corresponding cell

    Hi, I have attached sample excel which is replica of original.
    Requirement - which contains date wise tab. The last tab which has to be automated. This last tab pulls data from all other tab and count of who did how much work with count. Thanks in advance
    Attached Files Attached Files

  16. #16
    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,036

    Re: if cell range contains certain text then return value of corresponding cell

    you have merged cells all over the place. Their occurrence follows no logical pattern. Merged cells are a nightmare to cope with. I strongly suggest that you reconsider the format of the last sheet and get rid of ALL of the merged cells. I am certainly not going to spend hours trying to come up with a work-around.

  17. #17
    Registered User
    Join Date
    10-18-2011
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: if cell range contains certain text then return value of corresponding cell

    Glenn, appreciate if you could make merged cells into normal and provide me a solution.

  18. #18
    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,036

    Re: if cell range contains certain text then return value of corresponding cell

    Take a look at this. there's a lot going on. I will not attempt to explain any of until you are OK with the approach taken. Take a look and see if it is close enough to what you need.

    You will have to enable macros on opening (an old inbuilt Excel macro has been used to return a dynamic list of sheet names).

    You will quickly see that your original example in Post 1 was totally unrepresentative of your posted data. I just hope that the latest version is REALLY representative of what you are really using...

    Also... your example was an .xlsx file (excel 2007 and later), but your profile shows Excel 2003. Which do you use? Please amend your profile appropriately.

    Also, also: some of your column headers were inconsistent (corrected, but currently shaded orange). You need to ensure 100% consistency.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 05-03-2017 at 12:48 PM.

  19. #19
    Registered User
    Join Date
    10-18-2011
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: if cell range contains certain text then return value of corresponding cell

    Glenn, tremendous work. I have no words to express my gratitude. This is what I was exactly looking for. I will float the real data and get back for help
    Sorry about the confusions in excel and in my profile. Will update my profile. Thanks a lottt.

  20. #20
    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,036

    Re: if cell range contains certain text then return value of corresponding cell

    Hopefully it'll be OK on your real data: The summary rows are done more-or-less manually. Providing the number of individuals isn't too great and doesn't change too much, it should be OK.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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: 2
    Last Post: 10-03-2014, 03:46 AM
  2. [SOLVED] How to match a cell with text with a range of text and return own text
    By ec4excel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-16-2014, 11:07 AM
  3. Check if cell range has value and return text
    By Postlki1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-20-2013, 04:52 AM
  4. Replies: 7
    Last Post: 01-24-2013, 06:55 PM
  5. Search Text of Cell in a range and return the contents
    By knowing in forum Excel General
    Replies: 8
    Last Post: 11-19-2012, 08:57 AM
  6. [SOLVED] IF forumula to return text if a cell in a range contains a value <2
    By BPSJACK in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-08-2012, 08:05 AM
  7. Replies: 4
    Last Post: 05-12-2011, 02:25 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