+ Reply to Thread
Results 1 to 8 of 8

More robust formula to extract data

  1. #1
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Question More robust formula to extract data

    Hi, all

    I previously tried to apply HLOOKUP formula to capture the data based on month but it is really time consuming. Hence, I'm seeking for help as I'm new to functions.

    I have a sheet named "Raw" which stores all data and another sheet named "Summary". What I have to do is that, I have to extract data accordingly, based on the month in cell D1. The data has to change just like how when I applied the HLOOKUP formula in cell D2. Is it possible to do a more robust formula where I can simply drag it to the right and to the bottom?

    Hereby I attached an example of my file.

    I believe I have to use Index and Match after searching online but I'm not really sure either. Can anyone enlighten me?

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,791

    Re: More robust formula to extract data

    What do you mean by 'time-consuming' and 'more robust'?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: More robust formula to extract data

    When I apply HLOOKUP, I have to change the index num row accordingly for each cell. And more robust means that, I hope the formula can be easily dragged to the right without changing the formula in every cell, unlike what I did with HLOOKUP.

  4. #4
    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,036

    Re: More robust formula to extract data

    Please manually enter expected results for Branch C and repost your sheet.
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

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

    Re: More robust formula to extract data

    No reply....

    Your data layout is a bit of a mess!! Blank rows in a data table (e.g. Summary B3 & B4, etc) greatly increase the complexity. Also,you are flying up & down the date column, within each branch, rather randomly. So. No SIMPLE solution, I think.

    D2, copied down:

    =INDEX(Raw!$A$2:$P$49,MATCH(INDEX($B$2:$B$10,1+3*INT((ROWS($1:1)-1)/3)),Raw!$C$2:$C$49,0)+13+MOD((ROWS($1:1)-1),3),MATCH(Summary!$D$1,Raw!$A$1:$P$1,0))

    E2:
    Blank

    F2
    =INDEX(Raw!$A$2:$P$49,MATCH(INDEX($B$2:$B$10,1+3*INT((ROWS($1:2)-1)/3)),Raw!$C$2:$C$49,0)+(COLUMNS($E:E)-1)+MOD((ROWS($1:2)-1),3),MATCH(Summary!$D$1,Raw!$A$1:$P$1,0))

    G2:
    =INDEX(Raw!$A$2:$P$49,MATCH(INDEX($B$2:$B$10,1+3*INT((ROWS($1:3)-1)/3)),Raw!$C$2:$C$49,0)+6+(COLUMNS($E:E)-1)+MOD((ROWS($1:3)-1),3),MATCH(Summary!$D$1,Raw!$A$1:$P$1,0))

    Select E2,F2 and G2 TOGETHER. Drag across and down.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: More robust formula to extract data

    Hi, Glenn

    I was outside just now. Hurried back to my laptop to send the updated file to you. I have tried the formula and they work well, thank you so much despite the messiness and the confusion! Definitely a life savior!

    P/s: the template was made by my boss, sorry about that

  7. #7
    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,036

    Re: More robust formula to extract data

    Data layout courses should be compulsory for bosses....

  8. #8
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: More robust formula to extract data

    Quote Originally Posted by Glenn Kennedy View Post
    Data layout courses should be compulsory for bosses....
    I second that!

+ 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] Overwrite old data and filter using 2 parameters
    By ell_ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2018, 12:28 AM
  2. Filter primary pivottable Data Model with parameters from another table
    By George_1990 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2017, 11:01 AM
  3. [SOLVED] Sum column data based on parameters in row
    By ohi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-27-2016, 11:38 AM
  4. Dynamically change data based on parameters
    By MrWicked in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-07-2015, 04:47 AM
  5. [SOLVED] Locating a row in a table of data based on specified parameters
    By Marcos Aristotelous in forum Excel General
    Replies: 4
    Last Post: 01-20-2014, 04:37 PM
  6. How do I transfer User-Defined filter parameters to then filter another column?
    By fiqulupo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-28-2012, 07:05 PM
  7. [SOLVED] How to summarize data based on specific parameters
    By Water guy in forum Excel General
    Replies: 1
    Last Post: 02-07-2005, 07:06 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