SUMX problem

didijaba

Well-known Member
Joined
Nov 26, 2006
Messages
511
HI, I have related tables and I need to make calculated column that shows on how many days was some rate applied. There are two tables, one that shows customers and in what period they used service (days between OPENING_DATE and CLOSE_DATE) and second table that shows on what services what rate was applied (days between DATE_STAMP and DATE_STAMP_NEXT). This is formula I wanted to use in Rate table, and this is file.
https://drive.google.com/file/d/0B-ucSPLqBsATTFMtMmxyZC0zMjA/view?usp=sharing

Code:
=SUMX (
FILTER(
START_POINT;
START_POINT[HELP_COL_2]='QUERY_tbl_LOG'[HELP_COL_1] &&
START_POINT[OPENING_DATE]< 'QUERY_tbl_LOG'[NEXT_DATE_STAMP] );
INT ( 1
+ IF (
 ( 'QUERY_tbl_LOG'[NEXT_DATE_STAMP]) <= START_POINT[CLOSE_DATE]  ;
( 'QUERY_tbl_LOG'[NEXT_DATE_STAMP] );
START_POINT[CLOSE_DATE]
)
- IF (
( 'QUERY_tbl_LOG'[DATE_STAMP] ) >=START_POINT[OPENING_DATE] && ( 'QUERY_tbl_LOG'[DATE_STAMP] )< START_POINT[CLOSE_DATE];
( 'QUERY_tbl_LOG'[DATE_STAMP] );
START_POINT[OPENING_DATE]
)
)
)
 
Last edited:

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
SOLVED. I had error in HELP_COL_2 formula and I have changed full formula to
Code:
=SUMX (
FILTER(
START_POINT;
(START_POINT[HELP_COL_2])='QUERY_tbl_LOG'[HELP_COL_1] &&
START_POINT[RESERVATION_DATE]>='QUERY_tbl_LOG'[DATE_STAMP] &&
START_POINT[RESERVATION_DATE]<'QUERY_tbl_LOG'[NEXT_DATE_STAMP])
;
INT ( 1
+ IF (MONTH(START_POINT[CLOSE_DATE])=MONTH([OPENING_DATE]);
 START_POINT[CLOSE_DATE]  ;
 EOMONTH(START_POINT[OPENING_DATE];0))
-START_POINT[OPENING_DATE]))
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,873
Members
449,056
Latest member
ruhulaminappu

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