+ Reply to Thread
Results 1 to 24 of 24

Formula to find large value and pull non repeatiing value from adjacent column

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    42

    Formula to find large value and pull non repeatiing value from adjacent column

    Hello,

    I have following data set-
    COlumn A- A B C B D C E
    Column B- 67 65 65 65 63 62 61
    Column C- A A A Z B X

    I want to search for if column C cell is not empty, find large numbers in column B and corresponding value from column A

    Here the tweak is, if Column A has repeated value like for '65', 'B' is repeated than in that case it shall pull B for once only and then search for next large number i.e. 63

    Result in Column D shall be --- A B C D E

    Need your help please

    Thanks

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

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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
    Registered User
    Join Date
    01-16-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    42

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    I am attaching the sample excel sheet with query and expected result.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Try this ...

    =IF(ISERR(
    INDEX($A$3:$A$16,MATCH(LARGE(IF(COUNTIF($D$2:D2,$A$3:$A$16)=0,$B$3:$B$16),1),IF(COUNTIF($D$2:D2,$A$3:$A$16)=0,$B$3:$B$16),0))),"",
    INDEX($A$3:$A$16,MATCH(LARGE(IF(COUNTIF($D$2:D2,$A$3:$A$16)=0,$B$3:$B$16),1),IF(COUNTIF($D$2:D2,$A$3:$A$16)=0,$B$3:$B$16),0)))

    Enter with Ctrl+Shift+Enter.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Another way array entered then copied down. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

    =INDEX($A$3:$A$16,MATCH(LARGE(IF(FREQUENCY(IF($C$3:$C$16<>"",$B$3:$B$16),$B$3:$B$16),$B$3:$B$16),ROWS($3:3)),IF($C$3:$C$16<>"",$B$3:$B$16),0))


    Edit: Something I failed to mention above. Your in-workbook note states
    Data lenght can go to 1000's also
    If you are not aware of it array formulas are resource heavy.

    If your expected returns are also in the 1000's this formula might be slow to calculate. I have tried to find a non-array formula solution, but I do not think that I can do it without one or more helper columns.

    Are you open to using helper columns?
    Last edited by FlameRetired; 03-03-2017 at 07:38 PM.
    Dave

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    I went ahead and did another version that uses a helper column F. None of the formulas are array entered.

    The helper column can be hidden or placed out of sight to the extreme right ... even on another sheet.

    In the attached the helper column formula is
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The final formula in column D can then be
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Your profile says Excel 2003. You uploaded an *.xlsx file. The last formula will need to be modified if this has to work in 2003. Please take the time to update your profile. Members can then tailor solutions with that in mind.
    Last edited by FlameRetired; 03-05-2017 at 05:54 PM.

  7. #7
    Registered User
    Join Date
    01-16-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    42

    Smile Re: Formula to find large value and pull non repeatiing value from adjacent column

    Thanks to Mr. Phuocam and Mr. FlameRetired for ur help.

    I tried all 3 ways..last one was done by Mr. FlameRetired. I included the other two also, but Mr. Phuocam formula seems not giving the desired result..something i made mistake.

    Mr. Flameretired ur suggested formula are working, but i have concern, is in case data in A column is updated like in B10, if i change value from 'B' to say 'Z'. Results are not auto updated. Secondly if i change the reference range from '16' to '100', all the cells becomes blank.

    Can you please suggest any updation. Workbook attached herewith with all 3 formulas included.

    Thanks once again for giving time to my query.

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    You use Excel >=2007?

    Try in E3:

    =IFERROR( INDEX($A$3:$A$16,MATCH(LARGE(IF(COUNTIF($E$2:E2,$A$3:$A$16)=0,$B$3:$B$16),1),
    IF(COUNTIF($E$2:E2,$A$3:$A$16)=0,$B$3:$B$16),0)),"")

    Enter with Ctrl+Shift+Enter.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Re: The changed reference range. Try array entering this in G3 of your latest upload.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    but i have concern, is in case data in A column is updated like in B10, if i change value from 'B' to say 'Z'. Results are not auto updated.
    As I understand it that is what it is supposed to happen. Of the column B values (no duplicates) corresponding with non-blanks in column C the first of the second largest resulting numbers (now 67) is still in B4 and therefore should return A4 or "B". Why should "Z" in A10 change anything? 67 remains in B10 and is a duplicate of the B4 number and therefore not considered.

    What am I missing?

    Edit I interpreted something wrongly on the duplicates part. I'll need to sleep on this one.
    Last edited by FlameRetired; 03-06-2017 at 01:49 AM.

  10. #10
    Registered User
    Join Date
    01-16-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    42

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Once Again thanks to both of you for such a quick help.

    Mr. Phuocam formula- Only thing now missing here is consideration of column 'C', list shall be based for only filled cells in column ''C".I m using Office 2016.

    Mr. Flame Retired- Request is if for filled column in 'C', large value in 'B' and corresponding value from 'A', but value from 'A' shall not be repeated. Additionally, if same maximum number is there in column B for two different alphabets in 'A;, than formula shall list both from A. Formula shall ignore any duplicate value from A.
    The requirement is for filled cell in C, maximum values (descending order) in B and corresponding NON REPEATED alphabets from A

    Thank you very much both and appreciate your understanding and expertise in Excel.

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    OK.

    You did not mention before the blank cells after the data in columns A, B and C. That complicates the formula.

    So this time I made use dynamic named ranges for those columns, a dynamic named formula and a helper column.

    The dynamic named ranges are:

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


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


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


    And an indexing named formula

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


    Then this array entered formula in E3 to serve as a helper column
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and the final formula in D3 array entered
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    01-16-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    42

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Mr. FlameRetired: Great Sir, what a quick understanding and command on Excel.. How can i learn a bit of it?

    If Product Formula, u mentioned "zzzzzz" for match function...will this formula work for nay lenght of text or is limited to the number of 'z' specified? How can i make for any lenght text, may or may not be with numerals like "Atorva calcium 25".

    It is looking fine at this point...May i again disturb you, if i find any difficulty in this?

    Thanks

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    The idea behind the "zzzzzzz" is to supply a sufficiently large text value to do an approximate match on the column and force a match on the last row. The thought is that there is not likely to be a string that high alphabetically. It is good for text ranges.

    The same idea is behind the 1E+306. Supply a sufficiently large number to coerce an approximate match on the last row in a numeric range.

    Please feel free to come back if there are further difficulties.

    Edit: "Atorva calcium 25" would be treated as text. Use the "zzzzzzzzzzz" string on such a match.
    Last edited by FlameRetired; 03-06-2017 at 05:39 AM.

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Here is another way. Two helper columns non-array, a final simplified array formula and the same dynamic named ranges and named formula.

    In F3 and filled down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In E3 and filled down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and array entered in D3 and filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    01-16-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    42

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Thank you sir

  16. #16
    Registered User
    Join Date
    01-16-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    42

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Hello Sir
    Just a point , if in the excel sheet, if some more columns are added similar to column C and for each column, if same criteria to be applied, how to define formula.
    Attached the last sheet u updated with additional column.

  17. #17
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    You hadn't mentioned addition of extra columns before.

    This complicates things a little.

    The additional helper columns can be set far to the right to make room for additional 'Equipment' columns and output columns.

    Is there a limit to how many columns there will be?

    You will need to redefine the now more complex range references in the helper and final formulas as they are added.

    In the attached I copied the 'Equipment' headers to cells J1, L1 and N1.

    The helper formulas are now ... in J3 and filled down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In I3 and filled down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Select both of those helper column ranges, copy and paste into cells K1 and M1.

    Then array enter this new final formula in F3. Copy down and across column H. The range references will need to be adjusted as new columns
    are added to this as well.

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


    If there is a simpler way to do this it hasn't occurred to me yet.
    Last edited by FlameRetired; 03-07-2017 at 09:29 PM.

  18. #18
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    By the way I failed to mention in my post #17 above that this setup is designed to adapt to added 'Equipment' columns as they occur.

    If the number of 'Equipment' columns has a know limit then I think I can come up with something simpler.

  19. #19
    Registered User
    Join Date
    01-16-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    42

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Hello Sir,
    Thanks again.
    Maximum up to 40 columns it may go. Now the formulas are gone beyond my RAM, I am hang now.
    Appreciate your patience on my last minute additions and thanks for ur continued support.

  20. #20
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Quote Originally Posted by rakeshgarg1977 View Post
    Hello Sir,
    Thanks again.
    Maximum up to 40 columns it may go. Now the formulas are gone beyond my RAM, I am hang now.
    Appreciate your patience on my last minute additions and thanks for ur continued support.
    Also the in-workbook notes indicated 1000's of rows. Yikes!

    I am not surprised this exceeds limits, and I can not think of a formula work around for this.

    I am not VBA proficient, but your solution may require it.

    Let me see if I can get us some help.

  21. #21
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    I can almost make multiple Pivot tables work.

    However when there are ties in 'Weightage' I am unable to get 'Products' to sort the way you want them to.

  22. #22
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    Here's another approach. I managed to do all formulas non-array. I have not done a painstaking check. At least the results are the same. Check it out.

    In F3 filled across column H and down this helper formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then in I3 filled across column K and down this formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  23. #23
    Registered User
    Join Date
    01-16-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    42

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    I tried including and modifying some data, its working. Do u recommend to have helper cell for each column inclusion, if so additional very hidden helper sheet shall be created.

    Thank you so very much sir for your quickest response and giving time to solve my problem.

  24. #24
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to find large value and pull non repeatiing value from adjacent column

    You are very welcome. Yes my solution requires a helper column for each column of output.

    I was disappointed that I could only almost come up with a pivot table solution. That would have been ideal from a resource use standpoint.

+ 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. Looping 'find' to find a value and replace a value in an adjacent column
    By Boltsie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-12-2016, 06:54 PM
  2. [SOLVED] Vba to lookup for specif alphanumeric value in a column and pull value from adjacent cell
    By saravanan1981 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2016, 10:37 PM
  3. Replies: 2
    Last Post: 12-03-2014, 01:33 PM
  4. [SOLVED] Problem Using LARGE formula with Index/Match to pull values when there are Duplicates
    By BDavis in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-11-2014, 02:23 PM
  5. Replies: 6
    Last Post: 04-12-2013, 05:50 AM
  6. Pull unique values based on adjacent column
    By freud1 in forum Excel General
    Replies: 9
    Last Post: 07-02-2012, 11:36 AM
  7. LARGE Formula - Non-Adjacent Cells
    By TylerDCA in forum Excel General
    Replies: 1
    Last Post: 02-08-2010, 03:29 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