+ Reply to Thread
Results 1 to 3 of 3

need formula function or VBA to get the report as attached

  1. #1
    Forum Contributor
    Join Date
    06-12-2013
    Location
    india
    MS-Off Ver
    Office 365
    Posts
    163

    need formula function or VBA to get the report as attached

    Need your help to segregate the data as per the details given in the attached spread sheet(Sheet2 and Sheet3).

    1. In Raw data sheet I have numbers in column A and address in column B for each number but again I have some unwanted details in column B for each number.
    2. What I need is in Sheet 2, for each number where ever the cell starts with Location then in the C column needs to be update as "Address 1" and below that 2 cells needs to be filled as "Address2" and "Address3".
    3. In Sheet 3, I need number in A column, Address 1 in B column, Address2 in C column and Address 3 in D column.

    Note: some times we will get same number but the location address will be different.

    Kindly help me on how to handle this.....
    Attached Files Attached Files

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

    Re: need formula function or VBA to get the report as attached

    Try

    in Sheet2 C2

    =IF(LEFT('Raw Data'!$B2,8)="Location","Address 1",IF($C1="Address 1","Address 2",IF($C1="Address 2","Address 3","")))

    Copy down

    in Sheet3

    in A2

    =IFERROR(INDEX(Sheet2!$A$2:$A$98,SMALL(IF(Sheet2!$C$2:$C$98="Address 1",ROW(Sheet2!$A$2:$A$98)-ROW($A$2)+1,""),ROWS($A$2:A2))),"")

    in B2 and copy across to D and down

    =IFERROR(INDEX(Sheet2!$B$2:$B$98,SMALL(IF(Sheet2!$C$2:$C$98=B$1,ROW(Sheet2!$A$2:$A$98)-ROW($A$2)+1,""),ROWS($A$2:B2))),"")

    All entries in Sheet3 are ...


    ...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.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    06-12-2013
    Location
    india
    MS-Off Ver
    Office 365
    Posts
    163

    Re: need formula function or VBA to get the report as attached

    Thank you it helped me a lot but please help to understand why we need to use SMALL and ROW in index function on sheet 3.

+ 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. Require P&L program for my attached MIS report
    By sivaramakrishnan in forum Excel General
    Replies: 1
    Last Post: 03-09-2016, 03:38 PM
  2. [SOLVED] Want to Auto Report of attached file using Macro VBA
    By Mohsin Kodvavi in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-04-2015, 11:40 AM
  3. Can I use a Macro to generate a report for this spreadsheet as attached?
    By conks in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2013, 04:39 PM
  4. Replies: 10
    Last Post: 09-13-2013, 09:07 AM
  5. Replies: 0
    Last Post: 05-16-2012, 04:16 PM
  6. Replies: 4
    Last Post: 03-06-2012, 02:00 PM
  7. Automate Attached Report
    By pr4t3ek in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-05-2009, 07:30 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