+ Reply to Thread
Results 1 to 13 of 13

Anyone know a formula that exists for this?

  1. #1
    Registered User
    Join Date
    12-17-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Anyone know a formula that exists for this?

    Hi guys,

    This is my first post so please accept my apologies if I'm not doing this right!

    So I've spent ages trying to work this one out, but I haven't yet found a solution and would appreciate any help!

    My 'Concatenated Code' (col G) needs to be made up of the contents of columns D:F, whilst being unique to the fabricated employee numbers in column A.

    The COUNTIF in column C shows how many times each employee number exists in column A. So if possible, I'd only like the formula to bring back the relevant codes (from column B) and paste into the row for that employee number.

    Image below:

    Image2.png

    The end result will hopefully look like rows ("2:4") one in the image above. I only need 1 row of data per employee number, so if the formula can just bring back the data into the top row for that employee number then this would be an added bonus. No toruble removing duplicates though if this is too difficult!

    I've also attached the workbook. I know this might be a complicated one but hopefully one of you geniuses can help me

    Cheers

    Harry
    Attached Files Attached Files
    Last edited by Harry Sowden; 08-04-2015 at 10:21 AM.

  2. #2
    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,209

    Re: Anyone know a formula that exists for this?

    So for first employee (15656366) codes would be) H, E and A ??

    If so, employee occurrence is maximum of 3?

    Or am I going completely in wrong direction?

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

    Re: Anyone know a formula that exists for this?

    Can you post example of expected result for first employee?

  4. #4
    Registered User
    Join Date
    12-17-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Anyone know a formula that exists for this?

    Hi John

    Thank you for replying. In the sample data provided, yes, the maximum occurrence is 3 times. However in my official spreadsheet employees can appear up to 13 times in the list. I figured it would be easier to provide a smaller sample and then expand the formula in my real data afterwards.

    I've updated the image provided so hopefully this answers your last question.

    Any help would be appreciated

    Cheers

  5. #5
    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,209

    Re: Anyone know a formula that exists for this?

    Sorry but I cannot view the image. And need to clearly to understand the logic of getting the codes (with more than 3 occurrences of an employee).

    Can you add examples to the sample file INCLUDING >3 occurrences of an employee.

  6. #6
    Registered User
    Join Date
    12-17-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Anyone know a formula that exists for this?

    Hi John, I've attached a v2 of the example data to this post.

    I've manually typed what I would want the formula to bring back into the first few rows on the spreadsheet.

    Hope this helps! Let me know if you need anything else or are having trouble viewing.

    Thanks again!

    Harry
    Attached Files Attached Files

  7. #7
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Anyone know a formula that exists for this?

    wait- so, if an employee appears 13 times you want to bring back all 13 codes? (then use a formula to get a long concatenated code?)


    Obvious question - what happens if they appear 14 times?


    See attached - is that what you want?


    EDIT: FIXED ERROR IN INDEX FUNCTION (was missing mark by one row).

    Array Function Solution: =IFERROR(INDEX($B$1:$B$200,SMALL(IF($A$2:$A$200=$A2,ROW($A$2:$A$200)),COLUMNS($D$1:D$1))),"")

    Put that in D1, press cntrl+shift+enter, then drag the formula from that cell to the entire table as needed.
    Attached Files Attached Files
    Last edited by GeneralDisarray; 08-04-2015 at 11:02 AM.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  8. #8
    Registered User
    Join Date
    12-17-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Anyone know a formula that exists for this?

    Hi

    Yeah - I'd like it to bring back all 13 different codes. Haha, I'm starting to think I might be over-complicating this by going the wrong way about achieving my end result, but this way originally seemed easier to explain. This formula query only part of the overall process in which I need to figure out. I didn't want to post the whole thing on here, as it would probably be very hard to answer. Do you think it would be worth doing that though? Then linking this thread to it?

    Thanks for the help and time so far!

    ps - I believe 13 was the maximum number of times each employee number would appear, but if there was for example 14 appearances then I would add another column and drag the formula out (or update the references).

    Harry

  9. #9
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Anyone know a formula that exists for this?

    ok, have a look at post #7 then - that should do it for you.

    What's the next part?

  10. #10
    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,209

    Re: Anyone know a formula that exists for this?

    In D2

    =IFERROR(INDEX($B$2:$B$200,SMALL(IF($A$2:$A$200=$A2,ROW($A$2:$A$200)-ROW($A$2)+1,""),COLUMNS($D:D)))," ")

    Enter with Ctrl+Shilft+Enter

    Drag across and down

  11. #11
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Anyone know a formula that exists for this?

    @John.. great minds think alike

    @Harry.. go for it, link away

  12. #12
    Registered User
    Join Date
    12-17-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Anyone know a formula that exists for this?

    Hi

    That worked perfectly! Many thanks!! I still find it hard getting my head around the =SMALL function but I'll look into it more as it seems useful.

    I will create a workbook with sample data and try and best explain what I'm trying to achieve. I did not expect a perfect result so quickly so you've caught me off guard! Haha!

    I am about to leave work for the day but will prepare the relevant information tomorrow morning and upload it with my next reply.

    Thanks again for your time and perfect solution to my query!

    Also thanks, John! You guys are great.

    Cheers

    Harry

  13. #13
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Anyone know a formula that exists for this?

    No problem, please mark this thread as [SOLVED] and just start up another for the full question.

+ 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] determine if a formula exists within a cell
    By crowegreg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2013, 02:37 AM
  2. Replies: 4
    Last Post: 04-07-2011, 08:34 PM
  3. formula - if exists
    By btamulis in forum Excel General
    Replies: 3
    Last Post: 03-28-2011, 11:11 AM
  4. formula to indicate match exists
    By lukela85 in forum Excel General
    Replies: 9
    Last Post: 08-20-2009, 02:40 PM
  5. Formula to determine if an entry exists
    By GuruWannaB in forum Excel General
    Replies: 2
    Last Post: 07-21-2009, 11:55 AM
  6. Replies: 4
    Last Post: 03-08-2009, 09:22 AM
  7. Formula needed to tell me if a value exists
    By WhatF in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-10-2008, 08:16 AM

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