I Have one table as follows:

I need a formula like
cap16z1 = Min( 16 nov, z1),
cap16z2 = Min(16 nov, z2), and so on till cap16z7
cap23z1 = Min(23 nov,z1) ,
cap23z2 = Min(23nov, z2) and so on till cap23z7.
I have three formulas that needs to iterate from z1 to z7 and also needs t iterate through 4 dates say 16 nov, 23 nov, 30 nov, 1 dec. that comes up to total of 3*7*4 = 84 formulaes if written separately for each combination.
I tried creating a macro like below. But it overwrites my "cap" field data. and shows only 1 cap column instead of 7 for each date-zone combination.

I know java/C/C++/C# but not R and Python. 😞
Any ideas on how I can accomplish this task?