Pull data from sheet1 to sheet2 with condition

suusabox

New Member
Joined
Sep 26, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello,

So, i have question about pulling some data from sheet 1 to sheet 2.

In sheet1 i have destination and how far it is, on sheet2 i have empty table and cell named Total:

Now, what i would like excel to do for me is: when i write some random number in the Total: cell(Sheet 2) ie 234, it will pull data from sheet 1 and fill table on sheet 2 in random order, but total km will be 234.
So if i write there 432 it will bring more rows to match sum of 432km

Sheet 1 will have more destinations.


Can someone point in right direction here?



Sheet1(where the data is stored):
example2.xlsx
ABC
3from-todescriptiondistance in km
4start-destination 1- startclient meet23
5start-destination 2- startsale 45
6start-destination 3- startclient meet2
7start-destination 5- startpicking up tools3
8start-destination 6- startsale 1
9start-destination 7- startsale 10
10start-destination 8- startclient meet8
Leht1


Sheet2(whre output is stored, i filled it manually atm):
example2.xlsx
ABC
4from-todescriptiondistance in km
5start-destination 8- startclient meet8
6start-destination 2- startsale 45
7start-destination 1- startclient meet23
8start-destination 7- startsale 10
9start-destination 3- startclient meet2
10start-destination 2- startsale 45
11start-destination 6- startsale 1
12start-destination 2- startsale 45
13start-destination 6- startsale 1
14start-destination 1- startclient meet23
15start-destination 7- startsale 10
16start-destination 8- startclient meet8
17start-destination 5- startpicking up tools3
18start-destination 7- startsale 10
19
20
21Total:234
Leht2



Thank you in advance.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
with Excel 365 it can be done with a twist

  • Add running total column for distance on sheet 1
  • Then on sheet 2 filter results based on the total you have written - Filter being Running total <= Distance Total
  • Also since filter will give a spill range prefer putting total at top or some distant cell to avoid spill error.
Hope it helps you in some way
 
Upvote 0

Forum statistics

Threads
1,214,627
Messages
6,120,610
Members
448,973
Latest member
ChristineC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top