Finding Price from Matching Date and Yarn ID.

Vishnu75

New Member
Joined
May 9, 2023
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hi All,


Greetings to all.

I have a serious excel problem where I'm trying to find the <Price> in Table1 matching to 2 criteria in Table2.
1683619638259.png



Now, the issue is that <Created Date> in Table1 does not automatically exactly match that in Table2.


Which means:

1. that will need to do a close match of Table1<Created Date> with Table2<Created Date> with respective Yarn ID. (PS: One <Yarn Id> have multiple <Created Date> & multiple <Price>.
2. With above done, we will have <Matching Exact Created Date> & <Yarn ID>, we can then get the Exact <Price> from Table2.

Have paste the two tables below, please help.

Thanks



Table1
Created DateYarn IDFind Price?
21/07/20222546
29/06/20221990
29/07/20221084
29/07/20221233
05/09/20221543
05/09/20221543
07/07/20221202
20/07/20221990

Table2
Created DateYarn IDPrice
16/11/202210845.60
16/12/202210845.60
16/02/202310846.00
10/11/202112025.05
10/11/202112025.25
10/11/202112025.05
15/11/202112025.05
14/01/202212025.25
14/01/202212025.25
14/01/202212025.25
19/01/202212025.35
19/01/202212025.35
27/01/202212025.20
27/01/202212025.20
03/02/202212025.30
04/02/202212025.30
04/02/202212025.40
04/02/202212025.40
05/05/202212025.05
05/05/202212025.05
05/05/202212025.05
11/07/202212025.10
11/07/202212025.10
11/07/202212025.10
11/07/202212025.10
05/08/202212024.55
24/08/202212026.10
29/08/202212025.25
29/08/202212025.25
29/08/202212025.25
06/09/202212024.79
06/09/202212024.79
08/09/202212024.79
08/09/202212024.79
13/09/202212024.85
13/09/202212024.85
29/09/202212023.80
13/10/202212023.80
13/10/202212023.80
14/10/202212023.85
14/10/202212023.85
14/10/202212023.85
14/10/202212023.85
14/10/202212023.85
10/11/202212023.60
10/11/202212023.60
11/11/202212023.60
16/11/202212023.88
16/11/202212023.88
16/11/202212023.88
16/11/202212023.88
09/12/202212023.47
25/01/202312023.50
16/02/202312023.50
23/02/202312023.65
23/02/202312023.65
23/02/202312023.65
01/03/202312023.65
02/03/202312023.50
03/03/202312023.65
10/03/202312023.45
10/03/202312023.45
24/03/202312023.48
24/03/202312023.48
24/03/202312023.48
06/04/202312023.55
10/04/202312023.55
13/04/202312023.55
26/04/202312023.35
26/04/202312023.35
28/04/202312023.50
28/04/202312023.50
10/11/202112337.60
28/02/202212337.70
07/07/202212337.50
19/08/202212336.35
16/11/202212335.75
16/12/202212335.75
20/12/202119907.50
08/06/202219906.95
20/12/202125465.55
26/01/202225466.00
08/06/202225466.60
26/08/202225466.60
17/10/202225466.60
28/10/202225466.60
31/10/202225466.60
16/02/202325465.35
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
try this

Book1
ABC
1Table1
2Created DateYarn IDFind Price?
321/07/202225466.6
429/06/202219906.95
529/07/202210845.6
629/07/202212336.35
705/09/202215436.35
805/09/202215436.35
907/07/202212025.1
1020/07/202219906.95
11
12Table2
13Created DateYarn IDPrice
1416/11/202210845.6
1516/12/202210845.6
1616/02/202310846
1710/11/202112025.05
1810/11/202112025.25
1910/11/202112025.05
2015/11/202112025.05
2114/01/202212025.25
2214/01/202212025.25
2314/01/202212025.25
2419/01/202212025.35
2519/01/202212025.35
2627/01/202212025.2
2727/01/202212025.2
2803/02/202212025.3
2904/02/202212025.3
3004/02/202212025.4
3104/02/202212025.4
3205/05/202212025.05
3305/05/202212025.05
3405/05/202212025.05
3511/07/202212025.1
3611/07/202212025.1
3711/07/202212025.1
3811/07/202212025.1
3905/08/202212024.55
4024/08/202212026.1
4129/08/202212025.25
4229/08/202212025.25
4329/08/202212025.25
4406/09/202212024.79
4506/09/202212024.79
4608/09/202212024.79
4708/09/202212024.79
4813/09/202212024.85
4913/09/202212024.85
5029/09/202212023.8
5113/10/202212023.8
5213/10/202212023.8
5314/10/202212023.85
5414/10/202212023.85
5514/10/202212023.85
5614/10/202212023.85
5714/10/202212023.85
5810/11/202212023.6
5910/11/202212023.6
6011/11/202212023.6
6116/11/202212023.88
6216/11/202212023.88
6316/11/202212023.88
6416/11/202212023.88
6509/12/202212023.47
6625/01/202312023.5
6716/02/202312023.5
6823/02/202312023.65
6923/02/202312023.65
7023/02/202312023.65
7101/03/202312023.65
7202/03/202312023.5
7303/03/202312023.65
7410/03/202312023.45
7510/03/202312023.45
7624/03/202312023.48
7724/03/202312023.48
7824/03/202312023.48
7906/04/202312023.55
8010/04/202312023.55
8113/04/202312023.55
8226/04/202312023.35
8326/04/202312023.35
8428/04/202312023.5
8528/04/202312023.5
8610/11/202112337.6
8728/02/202212337.7
8807/07/202212337.5
8919/08/202212336.35
9016/11/202212335.75
9116/12/202212335.75
9220/12/202119907.5
9308/06/202219906.95
9420/12/202125465.55
9526/01/202225466
9608/06/202225466.6
9726/08/202225466.6
9817/10/202225466.6
9928/10/202225466.6
10031/10/202225466.6
10116/02/202325465.35
Sheet1
Cell Formulas
RangeFormula
C3:C10C3=INDEX($C$14:$C$101, MATCH(MIN(SQRT(($A$14:$A$101-A3)^2 + ($B$14:$B$101-B3)^2)), SQRT(($A$14:$A$101-A3)^2 + ($B$14:$B$101-B3)^2), 0))
 
Upvote 0
Hi Alan,
It Works!
Thanks very much.
Can you please explain this to me..
 
Upvote 0
Hi Alan,
It Works!
Thanks very much.
Can you please explain this to me..
I checked, it does not give the closest date.
Actually, it returns one of the date matching to the Yarn ID :((
You are the closest reply till now..
 
Upvote 0
What are your expected results & why?
 
Upvote 0
how about this? will pick up the non-existence ID in table 2

Book1
ABC
1Table1
2Created DateYarn IDFind Price?
321/07/202225466.6
429/06/202219906.95
529/07/202210845.6
629/07/202212336.35
705/09/20221543#N/A
805/09/20221543#N/A
907/07/202212025.1
1020/07/202219906.95
11
12Table2
13Created DateYarn IDPrice
1416/11/202210845.6
1516/12/202210845.6
1616/02/202310846
1710/11/202112025.05
1810/11/202112025.25
1910/11/202112025.05
2015/11/202112025.05
2114/01/202212025.25
2214/01/202212025.25
2314/01/202212025.25
2419/01/202212025.35
2519/01/202212025.35
2627/01/202212025.2
2727/01/202212025.2
2803/02/202212025.3
2904/02/202212025.3
3004/02/202212025.4
3104/02/202212025.4
3205/05/202212025.05
3305/05/202212025.05
3405/05/202212025.05
3511/07/202212025.1
3611/07/202212025.1
3711/07/202212025.1
3811/07/202212025.1
3905/08/202212024.55
4024/08/202212026.1
4129/08/202212025.25
4229/08/202212025.25
4329/08/202212025.25
4406/09/202212024.79
4506/09/202212024.79
4608/09/202212024.79
4708/09/202212024.79
4813/09/202212024.85
4913/09/202212024.85
5029/09/202212023.8
5113/10/202212023.8
5213/10/202212023.8
5314/10/202212023.85
5414/10/202212023.85
5514/10/202212023.85
5614/10/202212023.85
5714/10/202212023.85
5810/11/202212023.6
5910/11/202212023.6
6011/11/202212023.6
6116/11/202212023.88
6216/11/202212023.88
6316/11/202212023.88
6416/11/202212023.88
6509/12/202212023.47
6625/01/202312023.5
6716/02/202312023.5
6823/02/202312023.65
6923/02/202312023.65
7023/02/202312023.65
7101/03/202312023.65
7202/03/202312023.5
7303/03/202312023.65
7410/03/202312023.45
7510/03/202312023.45
7624/03/202312023.48
7724/03/202312023.48
7824/03/202312023.48
7906/04/202312023.55
8010/04/202312023.55
8113/04/202312023.55
8226/04/202312023.35
8326/04/202312023.35
8428/04/202312023.5
8528/04/202312023.5
8610/11/202112337.6
8728/02/202212337.7
8807/07/202212337.5
8919/08/202212336.35
9016/11/202212335.75
9116/12/202212335.75
9220/12/202119907.5
9308/06/202219906.95
9420/12/202125465.55
9526/01/202225466
9608/06/202225466.6
9726/08/202225466.6
9817/10/202225466.6
9928/10/202225466.6
10031/10/202225466.6
10116/02/202325465.35
Sheet1
Cell Formulas
RangeFormula
C3:C10C3=INDEX($C$14:$C$101, MATCH(MIN(ABS(A3-(B3=$B$14:$B$101)*$A$14:$A$101)), ABS((B3=$B$14:$B$101)*A3-$A$14:$A$101), 0))
 
Upvote 0
Solution
HI Alan,
In the module where both Table1 & Table2 are on same Sheet, it works perfectly.
But, actually, Table1 and Table2 are on separate sheets and I can't get the result, Why?
 
Upvote 0
What are your expected results & why?
Hi Fluff,

1. Expected Results: I want to extract the Price on Table2 by using the Created Date & YarnID on Table1 matching to same on Table2. NOw that only the CreatedDate on Table1 does not exactly match same on Table2 and hence I will need to get the closest date possible.
2. Why? - Actually, I have 2 Tables (Like explain above in different Sheets) and have <Price> information to extract for 3 YarnID column and final will be the Total Price.

Hope it clear what I'm trying to explain.
 
Upvote 0
Hi Fluff,

1. Expected Results: I want to extract the Price on Table2 by using the Created Date & YarnID on Table1 matching to same on Table2. NOw that only the CreatedDate on Table1 does not exactly match same on Table2 and hence I will need to get the closest date possible.
2. Why? - Actually, I have 2 Tables (Like explain above in different Sheets) and have <Price> information to extract for 3 YarnID column and final will be the Total Price.

Hope it clear what I'm trying to explain.
I Can send the whole table if needed.
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,148
Members
452,615
Latest member
bogeys2birdies

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