complicated calculation of price formula

Tripleseas

Board Regular
Joined
Jul 12, 2022
Messages
87
Office Version
  1. 2013
Platform
  1. Windows
Hello community

i'm working on worbook and i need to do some calculation like this :

depending on the price in the 3 differents rang ( Cell B3 to Cell D28 ) in comparisson the rang table , if that rang is detected i want the price in the base table to be multiplied by numbers of days in that month

I did some manual examples :
Cell D3 = 60 000 ---> it's in the rang 50 001 - 180 000 ----> result : 250 ( the price of the rang ) * 31 ( numbers of days of january )

i also seperated the rangs ! i want to the calculations of the months of rang 3 to be done based on column rang 3 and so on for the others.

hope i was clear and thank you for the help.

price formulas.xlsx
ABCDEFGHIJKLMNOP
1RANG 3Rang 1RANG 2
2Gare de péage Rang 1Rang 2 Rang 3JanvierFévrierMarsAvrilMaiJuinJuilletAoûtSeptembreOctobreNovembreDécembre
3X1120 00072 00060 0007750
4X280 00048 00040 000
5X340 00024 00020 000
6X4100 00060 00050 000
7X520 00012 00010 000
8X6100 00060 00050 000
9X710 0006 0005 000645,73
10X870 00042 00035 000Rang Price
11X920 00012 00010 0000-5 00020,83
12X1030 00018 00015 0005 001 -50 00083,33
13X115 0003 0002 50050 001 -180 000250,00
14X125 0003 0002 500
15X135 0003 0002 500
16X145 0003 0002 500
17X15180 000108 00090 000
18X1610 0006 0005 000
19X175 0003 0002 500
20X185 0003 0002 500
21X1915 0009 0007 500
22X205 0003 0002 500
23X215 0003 0002 500
24X225 0003 0002 500
25X235 0003 0002 500
26X2450 00030 00025 000
27X2545 00027 00022 500
28X268 0004 8004 000
Feuil1
Cell Formulas
RangeFormula
E3E3=250*31
E9E9=20.83*31
K12K12=100/1.2
 
Here is full sheet
Book1
ABCDEFGHIJKLMNOP
1123RANG 3Rang 1RANG 2
2Gare de péage Rang 1Rang 2 Rang 3Jan-22Feb-22Mar-22Apr-22May-22Jun-22Jul-22Aug-22Sep-22Oct-22Nov-22Dec-22
3X11200007200060000775070007750750077507500775077507500775075007750
4X2800004800040000258323332583250025832500775077507500258325002583
5X3400002400020000258323332583250025832500258325832500258325002583
6X41000006000050000258323332583250025832500775077507500775075007750
7X5200001200010000258323332583250025832500258325832500258325002583
8X61000006000050000258323332583250025832500775077507500775075007750
9X71000060005000646583646625646625258325832500258325002583
10X8700004200035000258323332583250025832500775077507500258325002583
11X9200001200010000258323332583250025832500258325832500258325002583
12X10300001800015000258323332583250025832500258325832500258325002583
13X11500030002500646583646625646625646646625646625646
14X12500030002500646583646625646625646646625646625646
15X13500030002500646583646625646625646646625646625646
16X14500030002500646583646625646625646646625646625646
17X1518000010800090000775070007750750077507500775077507500775075007750
18X161000060005000646583646625646625258325832500258325002583
19X17500030002500646583646625646625646646625646625646
20X18500030002500646583646625646625646646625646625646
21X191500090007500258323332583250025832500258325832500258325002583
22X20500030002500646583646625646625646646625646625646
23X21500030002500646583646625646625646646625646625646
24X22500030002500646583646625646625646646625646625646
25X23500030002500646583646625646625646646625646625646
26X24500003000025000258323332583250025832500258325832500258325002583
27X25450002700022500258323332583250025832500258325832500258325002583
28X26800048004000646583646625646625258325832500646625646
Sheet1
Cell Formulas
RangeFormula
E3E3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$D$3)*($S$4:$S$6>=$D3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($E$2,0))))
F3:F28F3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$D3)*($S$4:$S$6>=$D3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($F$2,0))))
G3:G28G3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$D3)*($S$4:$S$6>=$D3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($G$2,0))))
H3:H28H3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$D3)*($S$4:$S$6>=$D3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($H$2,0))))
I3:I28I3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$D3)*($S$4:$S$6>=$D3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($I$2,0))))
J3:J28J3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$D3)*($S$4:$S$6>=$D3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($J$2,0))))
K3:K28K3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$B3)*($S$4:$S$6>=$B3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($K$2,0))))
L3:L28L3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$B3)*($S$4:$S$6>=$B3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($L$2,0))))
M3:M28M3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$B3)*($S$4:$S$6>=$B3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($M$2,0))))
N3:N28N3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$C3)*($S$4:$S$6>=$C3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($N$2,0))))
O3:O28O3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$C3)*($S$4:$S$6>=$C3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($O$2,0))))
P3:P28P3=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$C3)*($S$4:$S$6>=$C3),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH($P$2,0))))
E4:E28E4=SUM(INDEX($T$4:$T$6,SMALL(IF(($R$4:$R$6<=$D$3)*($S$4:$S$6>=$D4),MATCH(ROW($T$4:$T$6),ROW($T$4:$T$6)),""),ROWS($A$1:$A$1)))*(DAY(EOMONTH(E3,0))))
thank a lot sir. amazing solution
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,214,950
Messages
6,122,436
Members
449,083
Latest member
Ava19

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