Calculate rates in periods

candeniz

New Member
Joined
Jan 16, 2015
Messages
18
Hi,
I have an excel table as in the image:

ABCDEFGH
1Start DateEnd DatePriceSeason
201.05.201915.05.201910AStart Date03.05.2019OR13.05.2019
316.05.201906.06.201920BEnd Date10.05.201920.05.2019
407.06.201903.07.201930C
504.07.201931.07.201940DPrice70110
601.08.201921.08.201950E
722.08.201910.09.201940D
811.09.201905.10.201930C
906.10.201931.10.201910A

<tbody>
</tbody>
















So my questions are:
  • How can I fix the formulas in F5 & H5 (to calculate the price between the selected dates even in one period or in a breaking period (H5; 3 days from season A and 4 days from season B)?
  • What can be the formula in column D (D2:D9) to assign the same letter if price is same?

Thanks indeed for your precious helps.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi Candeniz,
can you elaborate your calculation between dates?

Thanks for your reply.

The first formula in F5 will calculate the price regarding the criterias in F2 & F3 from the given rates in C2:C9. Here the crucial point is to make right calculation even in one period (as in F2 & F3 or in a broken period like H2 & H3). The second criterias (H2 & H3) are written as an example to display criterias varieties normaly I need one formula in F5 to calculate all cases.

The second formula I need in D3:D9 to assign the same letter regarding the figures in C2:C9. I mean same letter must be used again according to the previous figures similarities.
 
Upvote 0
could you confirm your example in F2 & F3, there are 8 days should equal to 80, similar to H2 & H3
 
Upvote 0
could you confirm your example in F2 & F3, there are 8 days should equal to 80, similar to H2 & H3
Sorry to state that the last day is always omitted from calculation so 10.05-03.05= 7 is right figure to calculate
 
Upvote 0
this works with a helper column E that can be hidden


Book1
ABCDEFGHI
1Start DateEnd DatePriceSeason
201/05/201915/05/201910A10Start Date03/05/201913/05/201913/05/2019
316/05/201906/06/201920B10End Date10/05/201920/05/201920/07/2019
407/06/201903/07/201930C10
504/07/201931/07/201940D10Price701101,920
601/08/201921/08/201950E10
722/08/201910/09/201940D-10
811/09/201905/10/201930C-10
906/10/201931/10/201910A-20
Sheet4
Cell Formulas
RangeFormula
G5=SUMPRODUCT(--(G3>$A$2:$A$9),G3-$A$2:$A$9,$E$2:$E$9)-SUMPRODUCT(--(G2>$A$2:$A$9),G2-$A$2:$A$9,$E$2:$E$9)
E3=C3-C2
D2=CHOOSE(C2/10,"A","B","C","D","E")
 
Last edited:
Upvote 0
Thanks AlanY works fine but also have another approach from excelforum as in the following really works well:

Calculation Formula

{SUM(IF(($A$2:$A$9>F$3)+($B$2:$B$9<F$2),0,IF(1+$B$2:$B$9>F$3,F$3,1+$B$2:$B$9)-<f$2),0,if(1+$b$2:$b$9><f$2,f$2,$a$2:$a$9))*($c$2:$c$9))}
</f$2,f$2,$a$2:$a$9))*($c$2:$c$9))}
</f$2),0,if(1+$b$2:$b$9><f$2),0,if(1+$b$2:$b$9><f$2,f$2,$a$2:$a$9))*($c$2:$c$9))}
<f$2),0,if(1+$b$2:$b$9><f$2,f$2,$a$2:$a$9))*($c$2:$c$9))}
IF($A$2:$A$9<F$2,F$2,$A$2:$A$9))*($C$2:$C$9))}
Season Letters Formula

<code>=IF(C2="","",IFERROR(VLOOKUP($C2,$C$1:$D1,2,0),CHAR(64+SUMPRODUCT(($C$2:$C2<>"")/COUNTIFS($C$2:$C2,$C$2:$C2&"")))))

Regards</code>
</f$2,f$2,$a$2:$a$9))*($c$2:$c$9))}
</f$2),0,if(1+$b$2:$b$9></f$2,f$2,$a$2:$a$9))*($c$2:$c$9))}
</f$2),0,if(1+$b$2:$b$9>
 
Last edited:
Upvote 0
Re: Calculate rates in periods - SOLVED

My Previous message is incompleted now corrected in this link

<f$2),0,if(1+$b$2:$b$9><f$2,f$2,$a$2:$a$9))*($c$2:$c$9))<f$2),0,if(1+$b$2:$b$9><f$2,f$2<f$2,f$2,$a$2:$a$9))*($c$2:$c$9))<f$2,f$2,$a$2:$a$9))*($c$2:$c$9))}
<f$2),0,if(1+$b$2:$b$9><f$2,f$2,$a$2:$a$9))*($c$2:$c$9))<f$2),0,if(1+$b$2:$b$9><f$2,f$2,$a$2:$a$9))*($c$2:$c$9))
<f$2,f$2,$a$2:$a$9))
<code></code></f$2,f$2,$a$2:$a$9))
</f$2,f$2,$a$2:$a$9))*($c$2:$c$9))
</f$2,f$2,$a$2:$a$9))*($c$2:$c$9))<f$2),0,if(1+$b$2:$b$9></f$2),0,if(1+$b$2:$b$9></f$2,f$2<f$2,f$2,$a$2:$a$9))*($c$2:$c$9))<f$2,f$2,$a$2:$a$9))*($c$2:$c$9))}
</f$2,f$2,$a$2:$a$9))*($c$2:$c$9))<f$2),0,if(1+$b$2:$b$9></f$2),0,if(1+$b$2:$b$9>https://photos.app.goo.gl/GPRNnqsZqZuWR47r6<f$2),0,if(1+$b$2:$b$9><f$2,f$2,$a$2:$a$9))*($c$2:$c$9))}
</f$2,f$2,$a$2:$a$9))*($c$2:$c$9))}
</f$2),0,if(1+$b$2:$b$9>
 
Upvote 0
Re: Calculate rates in periods - SOLVED

Cross posted https://www.excelforum.com/excel-fo...7-calculate-rates-in-periods.html#post5067373

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,215,422
Messages
6,124,808
Members
449,191
Latest member
rscraig11

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