How Index, Match return a value depends on earlier, current and further date?

Anbuselvam

Board Regular
Joined
May 10, 2017
Messages
97
Dear All,

Please find the excel sheet which is having Master sheet, permanent and teporary sheets.

Master sheet is output sheet

Temporary and permanent are my product formulation sheet.

I need to extract formulations from those two sheets to master sheet with a contions of Product name and creation date of product formulation.

For getting the results, i have some formulation and i did not get desired value.

Please check the attachments and do the needfull.

Note: In master sheet i have added expected results too for your study.

Sincerely yours
Anbuselvam K

Attachments:

Permanent

DateProductIncredient 1Incredient 2Incredient 4Incredient 5Incredient 6Incredient 7Incredient 8Incredient 10Incredient 11Incredient 12
19-Mar-15Vitamin 1213.13%2.99%19.91%0.01%0.09%
19-Mar-15Vitamin 166.52%3.00%30.36%0.02%0.10%
27-Jun-15Vitamin 256.93%17.86%3.22%21.78%0.08%0.02%0.10%
19-Mar-15Vitamin 37.46%86.60%2.97%2.97%0.01%
19-Mar-15Vitamin 410.23%89.77%0.00%
19-Mar-15Vitamin 518.63%73.62%3.95%3.80%
19-Mar-15Vitamin 610.95%81.24%3.46%4.35%
19-Mar-15Vitamin 77.74%85.26%3.00%4.00%0.00%
19-Mar-15Vitamin 85.00%94.60%0.40%
19-Mar-15Vitamin 912.16%80.08%3.37%4.39%0.00%
19-Mar-15Vitamin 108.10%83.59%2.97%5.34%
19-Mar-15Vitamin 1196.65%2.75%0.60%

<tbody>
</tbody>

Temporary


DateProductIncredient 1Incredient 2Incredient 4Incredient 5Incredient 6Incredient 7Incredient 8Incredient 10Incredient 11Incredient 12
2-May-16Vitamin 1263.87%13.13%1.00%22.00%6.00%0.09%
2-May-15Vitamin 10066.52%3.00%30.36%0.02%0.10%
2-May-15Vitamin 10156.93%17.86%3.22%21.78%0.08%0.02%0.10%
2-May-15Vitamin 1027.46%86.60%2.97%2.97%0.01%
2-May-15Vitamin 10310.23%89.77%0.00%
2-May-15Vitamin 10418.63%73.62%3.95%3.80%
2-May-15Vitamin 10510.95%81.24%3.46%4.35%
2-May-15Vitamin 1067.74%85.26%3.00%4.00%0.00%
2-May-15Vitamin 1075.00%94.60%0.40%
2-May-15Vitamin 10812.16%80.08%3.37%4.39%0.00%
2-May-15Vitamin 109100.00%
2-May-15Vitamin 11096.65%2.75%0.60%

<tbody>
</tbody>

Master Sheet

DateProductIncredient 1Incredient 2Incredient 4Incredient 5Incredient 6Incredient 7Incredient 8Incredient 10Incredient 11Incredient 12
19-Mar-13Vitamin 1266.52%0.00%3.00%30.36%0.00%0.02%0.10%0.00%0.00%0.00%
19-Mar-15Vitamin 1256.93%17.86%3.22%21.78%0.08%0.02%0.10%0.00%0.00%0.00%
23-Mar-15Vitamin 127.46%86.60%2.97%2.97%0.00%0.01%0.00%0.00%0.00%0.00%
19-Mar-16Vitamin 1210.23%89.77%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
21-Mar-16Vitamin 1218.63%73.62%3.95%3.80%0.00%0.00%0.00%0.00%0.00%0.00%
1-May-16Vitamin 1210.95%81.24%3.46%4.35%0.00%0.00%0.00%0.00%0.00%0.00%
5-May-17Vitamin 127.74%85.26%3.00%4.00%0.00%0.00%0.00%0.00%0.00%0.00%
21-May-17Vitamin 125.00%94.60%0.00%0.00%0.40%0.00%0.00%0.00%0.00%0.00%
23-May-17Vitamin 1212.16%80.08%3.37%4.39%0.00%0.00%0.00%0.00%0.00%0.00%

<tbody>
</tbody>

Master Sheet C2 formula is

=IF($P4 = 0, INDEX(Permanent!$C$3:$L$14, $O4, MATCH(C$3, Permanent!$C$2:$L$2, 0)), INDEX(Temporary!$C$3:$L$14, $P4, MATCH(C$3, Temporary!$C$2:$L$2, 0)))

Across and down.

Expected Results in Master Sheet

DateProductIncredient 1Incredient 2Incredient 4Incredient 5Incredient 6Incredient 7Incredient 8Incredient 10Incredient 11Incredient 12
19-Mar-13Vitamin 120.131270.029870.199140.00010.0009
19-Mar-15Vitamin 120.131270.029870.199140.00010.0009
23-Mar-15Vitamin 120.131270.029870.199140.00010.0009
19-Mar-16Vitamin 120.131270.029870.199140.00010.0009
21-Mar-16Vitamin 120.131270.029870.199140.00010.0009
1-May-16Vitamin 120.131270.029870.199140.00010.0009
5-May-17Vitamin 120.638720.131270.010.220.060.0009
21-May-17Vitamin 120.638720.131270.010.220.060.0009
23-May-17Vitamin 120.638720.131270.010.220.060.0009

<tbody>
</tbody>
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
on 19th March 2013 there is no Vitamin 12 so where do you get the ingredients from ?

It should take the value from next available date which is 19-Mar-2015.



what is temporary sheet for?

I have formulations in permanent and temporary which are used by regularly and rarely?
 
Upvote 0
permanent
DateProductIncredient 1Incredient 2Incredient 4Incredient 5Incredient 6Incredient 7Incredient 8Incredient 10Incredient 11Incredient 12
19-Mar-13Vitamin 1213.13%2.99%19.91%0.01%0.09%
Temporary
Date
ProductIncredient 1Incredient 2Incredient 4Incredient 5Incredient 6Incredient 7Incredient 8Incredient 10Incredient 11Incredient 12
02-May-16Vitamin 1263.87%13.13%1.00%22.00% 6.00%0.09%
Master Sheet
Date
ProductIncredient 1Incredient 2Incredient 4Incredient 5Incredient 6Incredient 7Incredient 8Incredient 10Incredient 11Incredient 12
19-Mar-13Vitamin 1266.52%0.00%3.00%30.36%0.00%0.02%0.10%0.00%0.00%0.00%
19-Mar-15Vitamin 1256.93%17.86%3.22%21.78%0.08%0.02%0.10%0.00%0.00%0.00%
23-Mar-15Vitamin 127.46%86.60%2.97%2.97%0.00%0.01%0.00%0.00%0.00%0.00%
19-Mar-16Vitamin 1210.23%89.77%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
21-Mar-16Vitamin 1218.63%73.62%3.95%3.80%0.00%0.00%0.00%0.00%0.00%0.00%
01-May-16Vitamin 1210.95%81.24%3.46%4.35%0.00%0.00%0.00%0.00%0.00%0.00%
05-May-17Vitamin 127.74%85.26%3.00%4.00%0.00%0.00%0.00%0.00%0.00%0.00%
21-May-17Vitamin 125.00%94.60%0.00%0.00%0.40%0.00%0.00%0.00%0.00%0.00%
23-May-17Vitamin 1212.16%80.08%3.37%4.39%0.00%0.00%0.00%0.00%0.00%0
Expected Results in Master Sheet
Date
ProductIncredient 1Incredient 2Incredient 4Incredient 5Incredient 6Incredient 7Incredient 8Incredient 10Incredient 11Incredient 12
19-Mar-13Vitamin 12 0.131270.029870.19914 0.00010.0009
19-Mar-15Vitamin 12 0.131270.029870.19914 0.00010.0009
23-Mar-15Vitamin 12 0.131270.029870.19914 0.00010.0009
19-Mar-16Vitamin 12 0.131270.029870.19914 0.00010.0009
21-Mar-16Vitamin 12 0.131270.029870.19914 0.00010.0009
01-May-16Vitamin 12 0.131270.029870.19914 0.00010.0009
05-May-17Vitamin 120.638720.131270.010.22 0.060.0009
21-May-17Vitamin 120.638720.131270.010.22 0.060.0009
23-May-17Vitamin 120.638720.131270.010.22 0.060.0009
you have only one row of vitamin12 data in permanent and temporary - so how do you get 9 rows in master sheet
and your expected results are identical for 6 rows - how did they change on 5 may 2017
I am not at all clear (yet) what you want
all I can see is - the vitamin12 formulation was unchanged from 19 march 13 but changed in temporary on 2 may 16
and master sheet shows changes on 8 dates
your expected results are CONSTANT until 5 may 2017
Please try and explain what this data means and what you want from it…

<colgroup><col><col><col><col><col><col><col><col><col><col span="4"></colgroup><tbody>
</tbody>
 
Upvote 0
you have only one row of vitamin12 data in permanent and temporary - so how do you get 9 rows in master sheet?

The one row is the date of creation of Vitamin 12 in the permanent sheet by 19-Mar-13 and the next change in formulation in Temporary sheet on 02-May-2016

In the master sheet date is production date.

we did so many productions from 19-Mar-2013 on different dates by using that formulation from permanent sheet up to 02-May-2016, as the next changes in the Vitamin 12 in a temporary sheet on 02-May-2016.

As like Vitamin 12, we have 15 formulations and each formulation will change time to time. According to the changes by date wise, i need to extract the data from permanent and temporary sheets (Ingredients 1 to 12).


 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,091
Latest member
gaurav_7829

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