Forum Discussion

M_T_M_'s avatar
M_T_M_
Copper Contributor
Aug 05, 2023

How do I pull data from one sheet into another based on multiple matching criteria

I have a book1(monthly vehicle toll tag statement) table1. i need to pull amount for particular plaza on particular date for entire month (table2). 

Any help would be much appreciated.

 

Transaction Date TimeLicence Plate NoPlaza CodeAmount(DR)
17-07-2023 21:26123 219222370
17-07-2023 20:25123 219221372
17-07-2023 19:35123 218221570
17-07-2023 18:41123 362232365
17-07-2023 17:43123 362249375
17-07-2023 16:42123 362234270
17-07-2023 16:29123 362228375
17-07-2023 15:50123 362242230
16-07-2023 02:00123 362242230
16-07-2023 01:46123 362228375
16-07-2023 01:31123 362234270
16-07-2023 00:43123 362249375
15-07-2023 23:47123 362232365
15-07-2023 22:44123 218221570
15-07-2023 21:52123 219221370
15-07-2023 20:50123 219222180
   Amount
Licence Plate Novehicle in date & timevehicle out date & time 219222 219221 218221 362232 362249 362234 362228 362242 362242 362228 362234 362249 362232 218221 219221 219222
12315-07-2023 12:5017-07-2023 19:43                
12325-07-2023 12:5027-07-2023 19:43                

6 Replies

  • M_T_M_ 

    SUMIFS provide an alternative formulation that will allow the results to be generated with a single dynamic array formula.

    = SUMIFS(amount,
          licencePlate,    plate,
          transactionDate, ">="&dateIn,
          transactionDate, "<="&dateOut,
          PlazaCode,       code
      )

     

    • M_T_M_'s avatar
      M_T_M_
      Copper Contributor

      PeterBartholomew1 

      Thanks for the response.

       

      Sno1&2 in Table2 are sample results. data entered manually from table 1. For likewise result in sno3&4 function required.

      Serval hundred are there, manually data entry taking days to complete.

       

      note: table 1 and table 2 are in different workbook

       

      TABLE 1:

      Transaction Date TimeLicence Plate NoPlaza CodeAmount(DR)
      30-05-2023 16:18123 356023165
      30-05-2023 10:43123 120001245
      30-05-2023 09:19123 120002140
      30-05-2023 08:59123 118002145
      30-05-2023 07:24123 118001145
      30-05-2023 07:02123 11600175
      30-05-2023 06:10123 116003265
      29-05-2023 13:06123 116003525
      29-05-2023 11:38123 116001155
      29-05-2023 11:28123 118001295
      29-05-2023 09:54123 118002295
      29-05-2023 09:35123 120002285
      29-05-2023 08:07123 120001245
      28-05-2023 14:53123 356023165
      28-05-2023 08:47123 257003250
      27-05-2023 13:00123 0
      27-05-2023 12:58123 239700405
      27-05-2023 11:53123 3600270
      27-05-2023 11:46123 3600200
      27-05-2023 11:42123 3600210
      27-05-2023 11:20123 360026198
      27-05-2023 07:47123 059002150
      27-05-2023 06:55123 05900185
      26-05-2023 09:46123 059001165
      26-05-2023 08:10123 059002300
      25-05-2023 18:08123 3600260
      25-05-2023 17:45123 360021127
      25-05-2023 17:40123 3600200
      25-05-2023 17:31123 36002771
      25-05-2023 16:46123 239700405
      24-05-2023 19:36123 257003250
      24-05-2023 10:48123 356023165
      23-05-2023 19:46123 120001120
      23-05-2023 18:17123 120002140
      23-05-2023 17:56123 118002145
      23-05-2023 16:27123 118001145
      23-05-2023 16:06123 11600175
      23-05-2023 14:52123 116003265
      23-05-2023 10:10123 116003525
      23-05-2023 08:48123 116001155
      23-05-2023 08:38123 118001295
      23-05-2023 07:11123 0
      23-05-2023 07:10123 118002295
      23-05-2023 06:50123 120002285
      22-05-2023 20:47123 120001245
      22-05-2023 14:31123 356023165
      21-05-2023 16:09123 257002260
      21-05-2023 14:59123 257001310
      21-05-2023 13:46123 356008520
      21-05-2023 12:05123 356007550
      21-05-2023 10:48123 356006550
      19-05-2023 20:16123 356006550
      19-05-2023 19:01123 0
      19-05-2023 19:00123 356007550
      19-05-2023 17:29123 356008520
      19-05-2023 16:14123 257001310
      19-05-2023 15:00123 257002260
      19-05-2023 08:27123 356023165
      18-05-2023 17:47123 120001245
      18-05-2023 16:31123 120002285
      18-05-2023 16:12123 118002295
      18-05-2023 13:59123 118001145
      18-05-2023 13:37123 116001155
      18-05-2023 12:22123 116003265
      17-05-2023 18:23123 0
      17-05-2023 18:21123 116003525
      17-05-2023 16:31123 118001295
      17-05-2023 14:51123 118002295
      17-05-2023 14:29123 120002285
      17-05-2023 12:55123 120001245
      17-05-2023 06:42123 356023165
      15-05-2023 06:46123 356023165
      14-05-2023 15:51123 120001245
      14-05-2023 14:23123 120002285
      14-05-2023 14:04123 118002295
      14-05-2023 12:36123 118001145
      14-05-2023 12:11123 11600175
      14-05-2023 09:37123 116003265
      13-05-2023 17:25123 116003525
      13-05-2023 15:27123 116001155
      13-05-2023 15:13123 0
      13-05-2023 15:09123 118001295
      13-05-2023 13:27123 118002295
      13-05-2023 13:07123 120002285
      13-05-2023 11:22123 120001245
      12-05-2023 19:02123 356023165
      12-05-2023 08:19123 257002260
      12-05-2023 07:02123 257001310
      11-05-2023 20:12123 356008520
      11-05-2023 18:33123 356007550
      11-05-2023 17:24123 356006550
      09-05-2023 10:53123 356006550
      09-05-2023 09:41123 0
      09-05-2023 09:40123 356007550
      09-05-2023 07:58123 356008520
      09-05-2023 06:45123 257001310
      08-05-2023 19:42123 257002260
      07-05-2023 12:15123 257003250
      05-05-2023 20:02123 257003250

      TABLE 2:

      S NoLicence Plate NoDate 356023 120001 120002 118002 118001 116001 116003 116003 116001 118001 118002 120002 120001 356023Amount
      112312-05-2023165245285295295155525265751452952852451653440
      212316-05-202316524528529529505252651551452952852451653365
      312322-05-2023              3020
      412328-05-2023              3145
    • M_T_M_'s avatar
      M_T_M_
      Copper Contributor

      OliverScheurich Thanks for the response.

       

      Sno1&2 in Table2 are sample results. data entered manually from table 1. For likewise result in sno3&4 function required.

      Serval hundred are there, manually data entry taking days to complete.

       

      TABLE 1:

      Transaction Date TimeLicence Plate NoPlaza CodeAmount(DR)
      30-05-2023 16:18123 356023165
      30-05-2023 10:43123 120001245
      30-05-2023 09:19123 120002140
      30-05-2023 08:59123 118002145
      30-05-2023 07:24123 118001145
      30-05-2023 07:02123 11600175
      30-05-2023 06:10123 116003265
      29-05-2023 13:06123 116003525
      29-05-2023 11:38123 116001155
      29-05-2023 11:28123 118001295
      29-05-2023 09:54123 118002295
      29-05-2023 09:35123 120002285
      29-05-2023 08:07123 120001245
      28-05-2023 14:53123 356023165
      28-05-2023 08:47123 257003250
      27-05-2023 13:00123 0
      27-05-2023 12:58123 239700405
      27-05-2023 11:53123 3600270
      27-05-2023 11:46123 3600200
      27-05-2023 11:42123 3600210
      27-05-2023 11:20123 360026198
      27-05-2023 07:47123 059002150
      27-05-2023 06:55123 05900185
      26-05-2023 09:46123 059001165
      26-05-2023 08:10123 059002300
      25-05-2023 18:08123 3600260
      25-05-2023 17:45123 360021127
      25-05-2023 17:40123 3600200
      25-05-2023 17:31123 36002771
      25-05-2023 16:46123 239700405
      24-05-2023 19:36123 257003250
      24-05-2023 10:48123 356023165
      23-05-2023 19:46123 120001120
      23-05-2023 18:17123 120002140
      23-05-2023 17:56123 118002145
      23-05-2023 16:27123 118001145
      23-05-2023 16:06123 11600175
      23-05-2023 14:52123 116003265
      23-05-2023 10:10123 116003525
      23-05-2023 08:48123 116001155
      23-05-2023 08:38123 118001295
      23-05-2023 07:11123 0
      23-05-2023 07:10123 118002295
      23-05-2023 06:50123 120002285
      22-05-2023 20:47123 120001245
      22-05-2023 14:31123 356023165
      21-05-2023 16:09123 257002260
      21-05-2023 14:59123 257001310
      21-05-2023 13:46123 356008520
      21-05-2023 12:05123 356007550
      21-05-2023 10:48123 356006550
      19-05-2023 20:16123 356006550
      19-05-2023 19:01123 0
      19-05-2023 19:00123 356007550
      19-05-2023 17:29123 356008520
      19-05-2023 16:14123 257001310
      19-05-2023 15:00123 257002260
      19-05-2023 08:27123 356023165
      18-05-2023 17:47123 120001245
      18-05-2023 16:31123 120002285
      18-05-2023 16:12123 118002295
      18-05-2023 13:59123 118001145
      18-05-2023 13:37123 116001155
      18-05-2023 12:22123 116003265
      17-05-2023 18:23123 0
      17-05-2023 18:21123 116003525
      17-05-2023 16:31123 118001295
      17-05-2023 14:51123 118002295
      17-05-2023 14:29123 120002285
      17-05-2023 12:55123 120001245
      17-05-2023 06:42123 356023165
      15-05-2023 06:46123 356023165
      14-05-2023 15:51123 120001245
      14-05-2023 14:23123 120002285
      14-05-2023 14:04123 118002295
      14-05-2023 12:36123 118001145
      14-05-2023 12:11123 11600175
      14-05-2023 09:37123 116003265
      13-05-2023 17:25123 116003525
      13-05-2023 15:27123 116001155
      13-05-2023 15:13123 0
      13-05-2023 15:09123 118001295
      13-05-2023 13:27123 118002295
      13-05-2023 13:07123 120002285
      13-05-2023 11:22123 120001245
      12-05-2023 19:02123 356023165
      12-05-2023 08:19123 257002260
      12-05-2023 07:02123 257001310
      11-05-2023 20:12123 356008520
      11-05-2023 18:33123 356007550
      11-05-2023 17:24123 356006550
      09-05-2023 10:53123 356006550
      09-05-2023 09:41123 0
      09-05-2023 09:40123 356007550
      09-05-2023 07:58123 356008520
      09-05-2023 06:45123 257001310
      08-05-2023 19:42123 257002260
      07-05-2023 12:15123 257003250
      05-05-2023 20:02123 257003250

      TABLE 2:

      S NoLicence Plate NoDate 356023 120001 120002 118002 118001 116001 116003 116003 116001 118001 118002 120002 120001 356023Amount
      112312-05-2023165245285295295155525265751452952852451653440
      212316-05-202316524528529529505252651551452952852451653365
      312322-05-2023              3020
      412328-05-2023              3145
      • PeterBartholomew1's avatar
        PeterBartholomew1
        Silver Contributor

        M_T_M_ 

        I would suggest changing the data on Tabelle1 to be an Excel Table so that it scales with the input data.  Similarly any manual input fields on output table.  I note that the 'in' and 'out' times have disappeared for some reason.  The 'Plaza' codes would be created as a dynamic array (unique values, sorted) and referenced by the SUMIFS formula as a dynamic range.

         

        I have nothing to contribute on separate workbooks; I am fortunate to be able to avoid them.  It may  well be that the source workbook must be open if the destination sheet is to work

Resources