Help with dynamic formulas to transform bigger sets of data

locksmith55

New Member
Joined
Mar 6, 2022
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am here working with shipping data. The data shows shipping prices for different routes between China and Japan. The prices itself is not relevant for solving this problem so I have just replaced them all with 0. For certain dates, certain shipping rates will be valid. I have already made a function to determine which rates are valid based on today's date. I am then trying to make dynamic formulas that will populate N3:S3 with correct information associated with the valid routes today.

Would appreciate a solution that is not too complex. Use of helper columns is welcome. I have been trying to solve this problem for days now with little success. I appreciate any help I can get. I use MS365 office.


test 2 mr excel.xlsx
ABCDEFGHIJKLMNOPQRS
1SHIPPING COMPANYDHLDHLDHLDHLUPSUPSUPSUPSGet todays dateHOW I WANT IT TO LOOK LIKE
2ROUTE IDDHL0716USDHL0716USDHL0935USDHL0935USNYC12A0227NYC12A0227NYC12A0228NYC12A02287/24/2022Date Valid FromDate Valid ToRoute FromRoute DestinationShipping CompanyRoute ID
3DATE (from, to)6/15/20227/10/20227/11/20227/31/20226/1/20226/20/20226/21/20227/30/20227/11/20227/31/2022HONG KONGTokyoDHLDHL0935US
4Check if route is valid todayNOT VALIDNOT VALIDVALIDVALIDNOT VALIDNOT VALIDVALIDVALID7/11/20227/31/2022DALIANTokyoDHLDHL0935US
5From (cities)Destination (cities)7/11/20227/31/2022SHANGHAI TokyoDHLDHL0935US
6HONG KONGTokyo000000007/11/20227/31/2022XINGANG TokyoDHLDHL0935US
7DALIANTokyo000000007/11/20227/31/2022NINGBOTokyoDHLDHL0935US
8SHANGHAI Tokyo000000006/21/20227/30/2022HONG KONGTokyoUPSNYC12A0228
9XINGANG Tokyo000000006/21/20227/30/2022DALIANTokyoUPSNYC12A0228
10NINGBOTokyo000000006/21/20227/30/2022SHANGHAI TokyoUPSNYC12A0228
116/21/20227/30/2022XINGANG TokyoUPSNYC12A0228
12Additional Destinations (cities)000000006/21/20227/30/2022NINGBOTokyoUPSNYC12A0228
13Kyoto000000007/11/20227/31/2022HONG KONGKyotoDHLDHL0935US
14Osaka000000007/11/20227/31/2022DALIANKyotoDHLDHL0935US
15Sapporo000000007/11/20227/31/2022SHANGHAI KyotoDHLDHL0935US
167/11/20227/31/2022XINGANG KyotoDHLDHL0935US
177/11/20227/31/2022NINGBOKyotoDHLDHL0935US
186/21/20227/30/2022HONG KONGKyotoUPSNYC12A0228
196/21/20227/30/2022DALIANKyotoUPSNYC12A0228
206/21/20227/30/2022SHANGHAI KyotoUPSNYC12A0228
216/21/20227/30/2022XINGANG KyotoUPSNYC12A0228
226/21/20227/30/2022NINGBOKyotoUPSNYC12A0228
237/11/20227/31/2022HONG KONGOsakaDHLDHL0935US
247/11/20227/31/2022DALIANOsakaDHLDHL0935US
257/11/20227/31/2022SHANGHAI OsakaDHLDHL0935US
267/11/20227/31/2022XINGANG OsakaDHLDHL0935US
277/11/20227/31/2022NINGBOOsakaDHLDHL0935US
286/21/20227/30/2022HONG KONGOsakaUPSNYC12A0228
296/21/20227/30/2022DALIANOsakaUPSNYC12A0228
306/21/20227/30/2022SHANGHAI OsakaUPSNYC12A0228
316/21/20227/30/2022XINGANG OsakaUPSNYC12A0228
326/21/20227/30/2022NINGBOOsakaUPSNYC12A0228
337/11/20227/31/2022HONG KONGSapporoDHLDHL0935US
347/11/20227/31/2022DALIANSapporoDHLDHL0935US
357/11/20227/31/2022SHANGHAI SapporoDHLDHL0935US
367/11/20227/31/2022XINGANG SapporoDHLDHL0935US
377/11/20227/31/2022NINGBOSapporoDHLDHL0935US
386/21/20227/30/2022HONG KONGSapporoUPSNYC12A0228
396/21/20227/30/2022DALIANSapporoUPSNYC12A0228
406/21/20227/30/2022SHANGHAI SapporoUPSNYC12A0228
416/21/20227/30/2022XINGANG SapporoUPSNYC12A0228
426/21/20227/30/2022NINGBOSapporoUPSNYC12A0228
Input
Cell Formulas
RangeFormula
D1:D2,D6:J6,J1:J2,H1:H2,F1:F2D1=C1
L2L2=DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))
N3:N7,N33:N37,N13:N17,N23:N27N3=$E$3
O3:O7,O33:O37,O13:O17,O23:O27O3=$F$3
P3:Q7P3=A6
N8:N12,N38:N42,N18:N22,N28:N32N8=$I$3
O8:O12,O38:O42,O18:O22,O28:O32O8=$J$3
P8:Q12P8=A6
R3:R7,R13:R17,R23:R27R3=$E$1
S3:S7,S13:S17,S23:S27S3=$E$2
R8:R12,R18:R22,R28:R32R8=$I$1
S8:S12,S18:S22,S28:S32S8=$I$2
Q13:Q22Q13=$B$13
Q23:Q32Q23=$B$14
C4,E4,G4,I4C4=IF(AND($L$2>=C3,$L$2<=D3),"VALID","NOT VALID")
D4,F4,H4,J4D4=IF(AND($L$2>=C3,$L$2<=D3),"VALID","NOT VALID")
C7:J10,C12:J15C7=C6
R33:S37,P33:P42P33=P3
Q33:Q37Q33=$B$15
Q38:Q42Q38=Q33
R38:R42R38=R18
S38:S42S38=S28
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,224,812
Messages
6,181,083
Members
453,021
Latest member
Justyna P

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