search data in one column and return first result from another column.

davids4500

New Member
Joined
Jan 14, 2023
Messages
21
Office Version
  1. 365
Platform
  1. Windows
search a column of data for "Air Freshener" (E2:E6550) and when the first correct result, return the first date that appears from another column (N2:N6550) where it is not empty.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
My interpretation of what you might want is different. Is this what you mean?
If neither suggestion is what you want then perhaps a simple set of sample data and the expected results with XL2BB would help clarify.

24 01 13.xlsm
ENOPQ
1ItemFirst Date
2aAir Freshener18/07/2023
3b15/06/2023Detergent23/08/2023
4cOther23/08/2023
5Air Freshener
6e
7f
8g18/07/2023
9h19/07/2023
10Air Freshener
11Detergent
12k
13Other23/08/2023
14
First not empty
Cell Formulas
RangeFormula
Q2:Q4Q2=INDEX(N:N,AGGREGATE(15,6,ROW(N$2:N$6550)/((ROW(N$2:N$6550)>=MATCH(P2,E:E,0))*(N$2:N$6550<>"")),1))
 
Upvote 0
My interpretation of what you might want is different. Is this what you mean?
If neither suggestion is what you want then perhaps a simple set of sample data and the expected results with XL2BB would help clarify.

24 01 13.xlsm
ENOPQ
1ItemFirst Date
2aAir Freshener18/07/2023
3b15/06/2023Detergent23/08/2023
4cOther23/08/2023
5Air Freshener
6e
7f
8g18/07/2023
9h19/07/2023
10Air Freshener
11Detergent
12k
13Other23/08/2023
14
First not empty
Cell Formulas
RangeFormula
Q2:Q4Q2=INDEX(N:N,AGGREGATE(15,6,ROW(N$2:N$6550)/((ROW(N$2:N$6550)>=MATCH(P2,E:E,0))*(N$2:N$6550<>"")),1))
Screenshot Excel1.png

Thank you, Peter, maybe i didn't explain well enough. Product Name is actually Column "E", the column Supplier orders is actually Column "M" and the data field I require is Column N. So if there is the product "Air Freshener present in "E" (not always) and a supplier order present in M then return the first date that is showing for a supplier order Column N...I hope that is clearer. Thank you
 
Last edited:
Upvote 0
maybe i didn't explain well enough.
Yes, I think not. It wasn't clear that "Air Freshener" could have other text with it in the same cell, and there was no mention that a supplier order needed to exist.

Also ..
  • Where should the results be?
  • What is the name of the table this data is in?
  • I cannot copy from an image to test so ..
.. perhaps a simple set of sample data and the expected results with XL2BB would help ..
 
Upvote 0
Dear Peter SSs. Thank you for your help. I am having issues with the xl2bb not opening in protected view. I have attached a table. I have changed the columns and reduced the clutter.
Product Name is now Column "C", the column Supplier orders is now Column "F" and the data field I require is Column G. So if there is the product (For example) "Air Freshener (which also has other text in the field) present in "C" (not always) and a supplier order (Which must be present) in column "F" then return the first date in Column G .I hope that is clearer. Thank you. I will be using the formula in a spreadsheet on worksheet Keycategories!S2. Thank you.

Column AColumn BColumn CColumn DColumn EColumn FColumn GColumn H
AFR065204872Air Freshener Truck Don't Look Back (Ocean)15/01/20241215/01/2024
AFR157255927Air Freshener Beautiful Girl - Strawberry15/01/202419215/01/202430/05/2024
AFR157255927Air Freshener Beautiful Girl - Strawberry30/05/20249615/01/202430/05/2024
AFR172256671Air Freshener Make Difference Today15/01/202419215/01/2024
AFR191257962Air Freshener Stay Close15/01/202419215/01/202430/05/2024
AFR191257962Air Freshener Stay Close30/05/20244815/01/202430/05/2024
AFR192257963Air Freshener Sometimes15/01/202419215/01/2024
AFR205258599Air Freshener Pink Heart - Strawberry15/01/202419215/01/2024
AFR209258603Air Freshener Be Happy Van Orange30/05/202424030/05/2024
 
Upvote 0
I am having issues with the xl2bb not opening in protected view.
Have a look at the suggestions in this thread.

Where should the results be?
Did you answer this point? Are the expected results shown in post #6? If not can you manually fill in the expected results and post them?

What is the name of the table this data is in?
Doesn't seem that you answered this point either?

I will be using the formula in a spreadsheet on worksheet Keycategories!S2
What is the name of the worksheet the above data is in?
 
Upvote 0
Have a look at the suggestions in this thread.


Did you answer this point? Are the expected results shown in post #6? If not can you manually fill in the expected results and post them?


Doesn't seem that you answered this point either?


What is the name of the worksheet the above data is in?
The data provided is from worksheet ChreosStockarriving.
The expected result for the product 'Air freshener' is 15/01/2024 because it is the first date in the column that has an order for that product (Column F)
 
Upvote 0
Did you look at the XL2BB link that i suggested?


Thanks for the additional information. That just leaves this question
What is the name of the table this data is in?
From the image in post #4 it appears that the data is in a formal Excel table. What is the name of that table?
It can be found in the Name Manager section of the Formulas ribbon tab.
 
Upvote 0
Hi.
The name of the table is ChreosStockArriving.
I have looked at the link XL2BB and working on it...
I might get some help from my neighbour.
I appreciate your persistence.
Kindest regards
David
 

Attachments

  • MrExcelB.png
    MrExcelB.png
    62.9 KB · Views: 2
Upvote 0

Forum statistics

Threads
1,215,105
Messages
6,123,118
Members
449,096
Latest member
provoking

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