+ Reply to Thread
Results 1 to 10 of 10

Comparison with rows and columns for one set of records possible !!!?????????

  1. #1
    Registered User
    Join Date
    05-18-2016
    Location
    US
    MS-Off Ver
    2013
    Posts
    5

    Comparison with rows and columns for one set of records possible !!!?????????

    Hi All,

    Good day. I would like to get a clarification or confirmation from expertise whether the below listed scenario is doable using any Excel formulae or not? Any leads or hints will help out.

    I need to do a compare on the different column fields, then do compare between two different row fields in same column and pass the value of one cell field to next field if it satisfies. I will better explain this with the scenario which might make sense.

    The initial report looks like listed below.
    Please Login or Register  to view this content.
    For every set of Col-A record, we will be having minimum 2 records (rows) one record with '000' and other with '00N' and so on. My requirement is I should check for the col-B with in unique value of Col-A.

    For Example, consider the value '312' in Col-A having 4 records with 4 different values in Col-B. So we consider '000' as header records and Col-3 holds its description and Col-4 is Sub-description which will be filled with '---------------'. Coming to detailed records, rows with value '002','003' and '500' holds Col-3 value as header record description and corresponding sub-descriptions for their value in Col-4. So the output report should look like listed below for reference.

    Please Login or Register  to view this content.
    Please let me know if I am not clear with my requirements. Appreciate all your time and patience.

    Thanks

  2. #2
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Comparison with rows and columns for one set of records possible !!!?????????

    The easy and dirty way is to use Array Formula:
    Please Login or Register  to view this content.
    It's also an Array formula, so hold Ctrl-Shift and hit Enter when you enter it (If it's warped in { }, you've done it right)
    Afterward, drag it down, copy and paste it as Value later somewhere.
    Attached Files Attached Files
    Last edited by Lemice; 05-18-2016 at 11:11 PM. Reason: Added a sample file
    (copy pasta from Ford)
    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

    Regards,
    Lem

  3. #3
    Registered User
    Join Date
    05-18-2016
    Location
    US
    MS-Off Ver
    2013
    Posts
    5

    Re: Comparison with rows and columns for one set of records possible !!!?????????

    Hi Lem,

    Thanks for the quick response. Appreciate it. I tried your formula. But it works for the very first record (Header record) for every unique COL-A field value. For detail records, its not showing the actual required value. Instead it shows "#N/A". I tried correcting this "#N/A" by using TRIM or CLEAN. but it dint work out.

    I am using your formula =IF(B2="000",C2,INDEX(C:C,MATCH(B2&A2,B:B&A:A,0))) in the requested field and not wrapping it inside {}. If I do so, the formula wont work as expected. May I date to know the necessity of using { }?

    Kindly advice me. Thanks.

  4. #4
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Comparison with rows and columns for one set of records possible !!!?????????

    The { } means the formula is an Array Formula, for more information about it, you can read it at https://support.office.com/en-us/art...2-ecfd5caa57c7
    To simplify it, I made the formula match a column with a column in the searching field, which only possible through either a helper columns to do it for the formula, then use the value in it, making the searching range to be a single unified column, or make the said formula into an Array formula.

    If it is possible, can you put down your data and your desired results in a sample file and upload it?

  5. #5
    Registered User
    Join Date
    05-18-2016
    Location
    US
    MS-Off Ver
    2013
    Posts
    5

    Re: Comparison with rows and columns for one set of records possible !!!?????????

    Hi Lem,

    Attached the sample file for your review and reference. I tried the same and it dint work out for me. But thanks for the link you provided. It gave insight about array.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Comparison with rows and columns for one set of records possible !!!?????????

    Please check the attached file.

    You will see that the formula is wrapped inside a { } - only achievable through clicking on the formula bar (edit it), then hit Ctrl + Shift + Enter.

    Well, you can simply drag the formula down, it works too.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-18-2016
    Location
    US
    MS-Off Ver
    2013
    Posts
    5

    Re: Comparison with rows and columns for one set of records possible !!!?????????

    Hi lem,

    I believe this was misunderstanding in our communication. I need a report as attached in this post with Col-I is valid.

    sorry for the confusion caused.
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Comparison with rows and columns for one set of records possible !!!?????????

    Ops, I totally derped out there, please check this attached file instead.

    Basically I look up the combined value in the G and F column, and return the header value if it starts with a 0.

    The formula is still forcing text into numbers, let me know if it causes any error, I will force it to read stuffs as texts instead.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-18-2016
    Location
    US
    MS-Off Ver
    2013
    Posts
    5

    Re: Comparison with rows and columns for one set of records possible !!!?????????

    Hi Lem,

    Great. It works. Initially, I got #N/A error. Then corrected it using the excel help "How to correct a #N/A error in INDEX/MATCH functions". You also gave this info in your earlier reply. It took sometime for me to understand the usage of it. Before applying it, I changed the field type to text and it works as you mentioned in your latest reply.

    Thanks for the information. I learnt about INDEX and MATCH today. Appreciate your patience and thanks for your time.

  10. #10
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Comparison with rows and columns for one set of records possible !!!?????????

    Glad that I could help.

    If you have found a fitting solution to your problem, please mark the Thread as [SOLVED] using the Thread tools right above post #1. It keeps things neat and tidy.

    And have a great day!

+ 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: 8
    Last Post: 10-14-2015, 11:58 AM
  2. Transposing records from rows to columns
    By Subtone in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-08-2013, 07:42 AM
  3. Macro To Delete Duplicate Records (Rows), While Omiting Specific Columns
    By Orangeworker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2010, 12:37 PM
  4. DSUM with columns as records and rows as values
    By romeno in forum Excel General
    Replies: 2
    Last Post: 06-26-2009, 05:16 AM
  5. Merging records / creating new columns based on duplicate records
    By duklaprague in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-19-2007, 10:32 AM
  6. Comparison of records between two spreadsheets
    By Carolyn at VW in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-26-2006, 07:15 PM
  7. Tranposing Columns to Rows for Thousand Records
    By unknowndevice in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-26-2005, 06:05 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