+ Reply to Thread
Results 1 to 24 of 24

Need to find different values against same name

  1. #1
    Registered User
    Join Date
    09-28-2015
    Location
    Dhaka
    MS-Off Ver
    2007
    Posts
    31

    Need to find different values against same name

    Dear Sir,

    I am facing a problem when I use INDEX formula to find out the values against same name. I have 30 stock name (same name) but the values are different (30 different values, 1 or 2 may be same) in DATA (October & November) Sheet. When I use the INDEX matching formula, it returns me the same value. I am not an expert still I have tried several formulas. I am attaching an excel file herewith. Please note that I want the result (yellow & Blue column & Cell in "RESULT Sheet" where I will use a dropdown list button instead of using same name thirty times. Please help me, if possible.

    With thanks,
    Samorita
    Attached Files Attached Files

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

    Re: Need to find different values against same name

    Hi there. this can be achieved using this sort of array formula. This one returns the dates. Array Formulae are a little different from ordinary formulas in that they MUST be 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 the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See sheet for exact formulae used for each of the thhree columns

    Don't type the curly braces yourself - it won't work...

    Next time, PLEASE attach a SAMPLE sheet, not one with two MASSIVE sheets. That is totally unnecessary.
    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

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need to find different values against same name

    F2: "October"
    F3: "November"

    G2: =COUNTIF('DATA(October)'!C:C, RESULT!E4)
    G3: =COUNTIF('DATA (November)'!C:C, RESULT!E4)

    D5: =IF($C5>SUM($G$2:$G$3),"",IF($C5<=$G$2,INDEX('DATA(October)'!B:B,MATCH($E$4,'DATA(October)'!$C:$C,0)+ROW(A1)-1),INDEX('DATA (November)'!B:B,MATCH($E$4,'DATA (November)'!$C:$C,0)+ROW(A1)-$G$2-1)))

    Copy D5 down and across through F103.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need to find different values against same name

    Quote Originally Posted by Glenn Kennedy View Post

    Next time, PLEASE attach a SAMPLE sheet, not one with two MASSIVE sheets. That is totally unnecessary.
    An attached file in the *.xlsb format that is 1.29mb in size should give you an indication that the file is probably huge!

    I usually won't download a file if it's bigger than 15-20 kb in *.xlsx format.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Need to find different values against same name

    Exactly..... I'm paying roaming charges at the moment and i didn't see the size of this file until it was too late....

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need to find different values against same name

    Quote Originally Posted by Glenn Kennedy View Post
    Next time, PLEASE attach a SAMPLE sheet, not one with two MASSIVE sheets. That is totally unnecessary.
    good advice... thanks Glenn.

  7. #7
    Registered User
    Join Date
    09-28-2015
    Location
    Dhaka
    MS-Off Ver
    2007
    Posts
    31

    Re: Need to find different values against same name

    Dear JBeaucaire,

    I am very much pleased with your solution and it works perfectly but due to my little knowledge, I can not customize the formula when more sheets are added. As the file is more than 1.2 mbs, so I am attaching an image file. I am eagerly waiting for your kind response. Please note that I have to add new sheet (month-wise) every month. Should I change the formula every month?

    With thanks,
    Samorita
    Attached Images Attached Images
    Last edited by samorita; 09-29-2015 at 03:52 AM.

  8. #8
    Registered User
    Join Date
    09-28-2015
    Location
    Dhaka
    MS-Off Ver
    2007
    Posts
    31

    Re: Need to find different values against same name

    Dear Glenn Kennedy,

    Your formula works great but the problem arises when I add more sheet. Would you please have a look on the image file I have attached with JBeaucaire's reply. I am sorry that you had to pay extra roaming charge for helping me. And this time I have not attached large file, a simple image. Waiting for your kind help.

    With regards,
    Samorita
    Last edited by samorita; 09-29-2015 at 03:51 AM.

  9. #9
    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,139

    Re: Need to find different values against same name

    Unfortunately, some of us (me included) cannot see your iages at all!!

    So, a SMALL sample file is to be greatly preferred. Will you be wanting a fixed number of sheets, or an ever expanding list? I think that this is very quickly going to get too complicated for a formual-based solution and you might need to consider a VBA solution.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need to find different values against same name

    No formula based solution will survive endless addition of new sheets. Only VBA can do that.

    Glenn, tip of the day, I'm no fan of pics either, but when I really want to see one, I just open the page in Chrome instead of IE.

  11. #11
    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,139

    Re: Need to find different values against same name

    I use Firefox and have never had any problems until the new laptop decided that it wouldn't let me see images, even though i have specifically allowed the use of images from this site.

  12. #12
    Registered User
    Join Date
    09-28-2015
    Location
    Dhaka
    MS-Off Ver
    2007
    Posts
    31

    Re: Need to find different values against same name

    Quote Originally Posted by JBeaucaire View Post
    F2: "October"
    F3: "November"

    G2: =COUNTIF('DATA(October)'!C:C, RESULT!E4)
    G3: =COUNTIF('DATA (November)'!C:C, RESULT!E4)

    D5: =IF($C5>SUM($G$2:$G$3),"",IF($C5<=$G$2,INDEX('DATA(October)'!B:B,MATCH($E$4,'DATA(October)'!$C:$C,0)+ROW(A1)-1),INDEX('DATA (November)'!B:B,MATCH($E$4,'DATA (November)'!$C:$C,0)+ROW(A1)-$G$2-1)))

    Copy D5 down and across through F103.
    Dear JBeaucaire,

    I am sorry that you can not see the image file. Your formula works great for two sheets. Hence, my question is, How will I customize the formula when I have data in 3 or 4 sheets?, i,e. DATA(October), DATA (November), DATA (December), DATA (January). It would be a great help to me. Please help this friend.

    With thanks,
    Samorita

  13. #13
    Registered User
    Join Date
    09-28-2015
    Location
    Dhaka
    MS-Off Ver
    2007
    Posts
    31

    Re: Need to find different values against same name

    Quote Originally Posted by JBeaucaire View Post
    No formula based solution will survive endless addition of new sheets. Only VBA can do that.

    Glenn, tip of the day, I'm no fan of pics either, but when I really want to see one, I just open the page in Chrome instead of IE.
    Dear JBeaucaire,

    I am sorry that you can not see the image file. Your formula works great for two sheets (reference to your early post). Hence, my question is, How will I customize the formula when I have data in 3 or 4 sheets?, i,e. DATA(October), DATA (November), DATA (December), DATA (January). I have tried to do but I have failed. It does not return the correct result. It would be a great help to me if you customize the formula for me. Please help this friend.

    I have tried to customize your formula by the following way:

    F2: "October"
    F3: "November"
    F4: "December"
    F5: "January"

    G2: =COUNTIF('DATA(October)'!C:C, RESULT!E4)
    G3: =COUNTIF('DATA (November)'!C:C, RESULT!E4)
    G4: =COUNTIF('DATA (December)'!C:C, RESULT!E4)
    G5= COUNTIF('DATA (January)'!C:C, RESULT!E4)

    D5: =IF($C5>SUM($G$2:$G$3),"",IF($C5<=$G$2,INDEX('DATA(October)'!B:B,MATCH($E$4,'DATA(October)'!$C:$C,0)+ROW(A1)-1),IF($G$2<=$G$3,INDEX('DATA (November)'!B:B,MATCH($E$4,'DATA (November)'!$C:$C,0)+ROW(A1)-$G$2-1), IF($G$4=($G$2+$G$3),INDEX('DATA (December)'!B:B,MATCH($E$4,'DATA (December)'!$C:$C,0)+ROW(A1)-$G$2-1), IF($G$5<=($G$2+$G$3+$G$4),INDEX('DATA (January)'!B:B,MATCH($E$4,'DATA (January)'!$C:$C,0)+ROW(A1)-$G$2-1)))))))

    Copy D5 down and across through F103.

    With thanks,
    Samorita
    Last edited by samorita; 09-30-2015 at 12:49 AM.

  14. #14
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need to find different values against same name

    See if this makes it a little easier to read:

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    09-28-2015
    Location
    Dhaka
    MS-Off Ver
    2007
    Posts
    31

    Re: Need to find different values against same name

    Quote Originally Posted by JBeaucaire View Post
    See if this makes it a little easier to read:

    Please Login or Register  to view this content.
    Dear JBeaucaire,

    Thanks for everything. The above formula does not return the desired values. It returns the duplicate( First two months are okay), ie. Octobor, November, November, November. For Stock (First two is okay), i.e, AB, AB, ACI, ACIFORMULA. Whatever, Your effort is tremendously helping me to find two months value. If you have spare time, please try to upload the excel file so that I can use it in a better way. Otherwise, I will try to link every two months to make my task complete. Finally, Thank you again for being a helping friend.

    With regards,
    Samorita

  16. #16
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need to find different values against same name

    The I was able to help with the two sheet problem correctly because you provided a working two-sheet workbook.

  17. #17
    Registered User
    Join Date
    09-28-2015
    Location
    Dhaka
    MS-Off Ver
    2007
    Posts
    31

    Re: Need to find different values against same name

    Quote Originally Posted by JBeaucaire View Post
    The I was able to help with the two sheet problem correctly because you provided a working two-sheet workbook.
    Dear JBeaucaire,

    If you allow me, I can send you 10 mbs excell file with all sheets. Should I upload it here dear friend? or I will send an email? I am feeling lucky with your response. And I am feeling lucky also to be a member of this great forum.

    With regards,
    Samorita

  18. #18
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need to find different values against same name

    If there are 4 sheets to deal with, your small sample workbook uploaded here should have the 4 sheets. You would never upload a 10mb anything, right? Just a smaller desensitized version that allows the problem to be examined.

  19. #19
    Registered User
    Join Date
    09-28-2015
    Location
    Dhaka
    MS-Off Ver
    2007
    Posts
    31

    Re: Need to find different values against same name

    Quote Originally Posted by JBeaucaire View Post
    If there are 4 sheets to deal with, your small sample workbook uploaded here should have the 4 sheets. You would never upload a 10mb anything, right? Just a smaller desensitized version that allows the problem to be examined.
    Dear JBeaucaire,

    This is a 1.5 mbs file of 6 sheets. Most of the stocks are omitted from the sheets but "ABBANK" is in every sheet. Hope this will work. Waiting for your response, friend. If it is still huge, I can delete more stocks to reduce the file size.

    With regards,
    Samorita
    Attached Files Attached Files
    Last edited by samorita; 09-30-2015 at 11:30 AM.

  20. #20
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need to find different values against same name

    Not going to work any more on a formula that just doesn't expand with additional sheets. Here's a VBA solution that should work for any number of sheets.

    1) Right-click the RESULTS sheet tab and select VIEW CODE

    2) Paste in this macro to the window that appears:
    Please Login or Register  to view this content.
    3) Close the VBEditor

    4) Make an edit in E4....


    NOTE: If you ever want to bring back more columns of data, adjust the two parts marked in red.
    Last edited by JBeaucaire; 10-01-2015 at 09:32 AM.

  21. #21
    Registered User
    Join Date
    09-28-2015
    Location
    Dhaka
    MS-Off Ver
    2007
    Posts
    31

    Re: Need to find different values against same name

    Dear JBeaucaire,

    Thanks is not enough for such a helping friend like you. Your Vba works excellently. You have spent lots of time to help me. I will never forget your contribution. I pray to God for you. And one final request, if possible, please modify the macro for me to draw all headings, "DATE", "TRADING CODE", "LTP*", "HIGH", "LOW", "OPENP*", "CLOSEP*", "YCP", "TRADE", "VALUE (mn)", "VOLUME". No more request about this thread.

    Please be happy always.

    With regards,
    Your friend, Samorita
    Last edited by JBeaucaire; 10-01-2015 at 09:29 AM. Reason: Removed unnecessary quote.

  22. #22
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need to find different values against same name

    The macro is intended to UPDATE the sheet you already had laid out. So the headers must be there from the start.

    NOTE: PLease don't use the "Reply with Quote." Just use "Reply." Thanks.
    Last edited by JBeaucaire; 10-01-2015 at 09:28 AM.

  23. #23
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need to find different values against same name

    Check post #20 again. I marked two things in red. Adjust those if you're saying you want to bring back MORE columns of data.

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

  24. #24
    Registered User
    Join Date
    09-28-2015
    Location
    Dhaka
    MS-Off Ver
    2007
    Posts
    31

    Re: Need to find different values against same name

    Dear JBeaucaire,

    I have no word to thank you. May God bless you. It has solved all my problems. And I have marked the thread as solved also.

    With regards,
    Samorita

+ 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] Find count of Unique or Duplicate Values based on Concatenated values in 2 columns
    By bdicarlo1 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-03-2014, 12:42 AM
  2. [SOLVED] How can I use .find() to find values (not formulas of cells)?
    By vizzkid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2014, 08:56 AM
  3. Replies: 1
    Last Post: 04-30-2014, 05:49 PM
  4. Macro to find all specific values in column and replace adjacent cell values
    By dblock02 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2013, 06:03 AM
  5. Replies: 1
    Last Post: 04-19-2013, 08:30 PM
  6. [SOLVED] Using range.find to find two specific values in two columns
    By mhrub in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2012, 01:02 PM
  7. Replies: 0
    Last Post: 09-06-2012, 04:06 AM

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