ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Logic question. Comparing 2 lists. (https://www.excelbanter.com/excel-programming/438861-logic-question-comparing-2-lists.html)

Brian S

Logic question. Comparing 2 lists.
 
I am trying to seperate data based on 2 lists and can't seem to wrap my head
around it. I want to take the item in List1 and pull all the corresponding
occurances in list 2. (assume each word is in a different column.) The
result should be a 3rd list for all the car charges and a 4th list for the
truck charges. I don't want to sort list2 either. I would like to compare
the first item in list1 to the items in list2 and then compare the 2nd item
in list1 to all the items in list2. Hope that question makes sense. Thanks.

Something like this:
List1
Car
Truck

List2
Car gas $$$$
Truck gas $$$$
Car oilchange $$$
Car tires $$$$
Truck tires $$$$

Thanks.

Bernie Deitrick

Logic question. Comparing 2 lists.
 
Brian,

The easiest way is to filter your second list, and choose to show values
based on a custom filter on the first column, set to either "Car" or "Truck"

And the best thing to do is to sort your list, even though you don't want
to. Sorting is easy.

If you need a separate list, copy just the visible cells of your second list
and paste it somewhere else, then remove the filters.

HTH,
Bernie
MS Excel MVP



"Brian S" <Brian wrote in message
...
I am trying to seperate data based on 2 lists and can't seem to wrap my
head
around it. I want to take the item in List1 and pull all the
corresponding
occurances in list 2. (assume each word is in a different column.) The
result should be a 3rd list for all the car charges and a 4th list for the
truck charges. I don't want to sort list2 either. I would like to
compare
the first item in list1 to the items in list2 and then compare the 2nd
item
in list1 to all the items in list2. Hope that question makes sense.
Thanks.

Something like this:
List1
Car
Truck

List2
Car gas $$$$
Truck gas $$$$
Car oilchange $$$
Car tires $$$$
Truck tires $$$$

Thanks.




All times are GMT +1. The time now is 07:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com