+ Reply to Thread
Results 1 to 4 of 4

Query from an excel data base

  1. #1
    Registered User
    Join Date
    09-30-2013
    Location
    U.S.A
    MS-Off Ver
    Excel 2007
    Posts
    5

    Post Query from an excel data base

    Hello everyone !

    I am attaching an excel file with a customer name, date of birth, date of visit and value.

    I tried to get an output file with following results but failed.

    Please help.

    When a customer has a value less than 200 in the last three visits, I would like that information extracted.

    For example, Jack had 5 visits in different dates. Of those 5 visits, I am interested in his latest three visits with a value less than 200. It could be just one date with less than value 200 or all the three dates with less than 200. I want his name, date of visits, and value extracted.

    Thank you all as in the past.
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Query from an excel data base

    Hi Dave,
    You mention 'extracted' , could you be a little more specific?
    You could use a Pivot table to group the customers and their visits and values and just filter the ones with values < 200
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Valued Forum Contributor
    Join Date
    10-14-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    353

    Re: Query from an excel data base

    I used Advanced Filter and array-formulas and a small macro (VBA code)
    1 click on button [Run1] gives the results.
    Because of the VBA I saved the file as *.xlsm
    Attached Files Attached Files
    Kind regards,
    Piet Bom

  4. #4
    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: Query from an excel data base

    Another way.

    In columns F:G apply 'Remove Duplicates' as below.

    Then enter array formula in H2, copy down and across 6 columns. 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.


    =IFERROR(INDEX($D$2:$E$12,SMALL(IF((LARGE(IF(($F2=$A$2:$A$12)*($G2=$B$2:$B$12),$D$2:$D$12),{1,2,3})=IF(($F2=$A$2:$A$12)*($G2=$B$2:$B$12),$D$2:$D$12))*($E$2:$E$12<200),ROW($A$2:$A$12)-MIN(ROW($A$2:$A$12))+1),CEILING(COLUMNS($H:H)/2,1)),MOD(COLUMNS($H:H)-1,2)+1),"")


    Row\Col
    F
    G
    H
    I
    J
    K
    L
    M
    1
    Last Name
    First Name
    DoVisit
    Value
    DoVisit
    Value
    DoVisit
    Value
    2
    Agen Jack
    2/5/2017
    41
    1/5/2017
    180
    3
    Bob Jill
    1/8/2017
    50
    2/28/2017
    100
    3/1/2017
    40
    4
    Dave Liz
    2/14/2017
    150
    1/15/2017
    180
    1/1/2017
    190
    Dave

+ 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. Excel data base or access data base collection?
    By mcdonalds in forum Excel General
    Replies: 0
    Last Post: 02-17-2014, 08:04 AM
  2. how to transform data from row-base to column-base
    By fei2010 in forum Excel General
    Replies: 3
    Last Post: 11-23-2012, 12:17 AM
  3. Data base in excel
    By Bakar in forum Excel General
    Replies: 1
    Last Post: 09-13-2012, 12:26 AM
  4. convert non data base to data base format using formula
    By murarihyd in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-22-2011, 11:42 AM
  5. [SOLVED] Using Excel as a data base
    By J.W.R. in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-01-2006, 09:13 PM
  6. [SOLVED] excel data base
    By foothillsuvwcfv in forum Excel General
    Replies: 5
    Last Post: 05-20-2006, 05:50 AM
  7. [SOLVED] data base query
    By Klutzz in forum Excel General
    Replies: 0
    Last Post: 11-26-2005, 10:45 AM
  8. Error on new Data Base Query
    By MESTRELLA29 in forum Excel General
    Replies: 1
    Last Post: 02-09-2005, 03: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