Translate formula into Power Pivot

frankee_gee

Board Regular
Joined
Mar 3, 2008
Messages
144
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hope some one can help with this formula into Power Pivot:

I use this in an excel spreadsheet.
=SUMPRODUCT((I2:I2<=$AO$1)*(((J2:J2="")+(J2:J2>=$AO$1)>=1)))

$AO$1 is a date. we can replace with actual date of need be: We have separate columns for each 1/31/2014, 2/28/2014 & 3/31/2014.


or

I was told to use this instead but the above work for me. I did not test this.

=IF(OR(AND(J2<$AL$1,K2>$AL$1),AND(Z2="Erect",K2="")),1,0)


Thank you,

Frankee Gee.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I agree with whoever told you, SUMPRODUCT is pointless there, although I think it should be

=--(AND(I2:I2<=$AO$1,OR(J2:J2="",J2:J2>=$AO$1)))

You want this as a calculated column? What does the PowerPivot model look like, what tables, what columns, and how do these map onto the cells in your formula?
 
Upvote 0
Bardd,

Thanks for the reply.

One table: ProfieldC

Two columns:
1. ErectDate
2. DismantleDate
comparing to this date: 1/31/2014. I will also compare to 2/28/2014 & 3/31/2014. In other words this tells us how many rentals are still out on rent.


=SUMPRODUCT((ErectDate<=1/31/2014)*(((DismantleDate="")+(DismantleDate>=1/31/2014)>=1)))

What I'm trying to do is go back in time to capture information from the past.
 
Last edited:
Upvote 0
The Jan Test would be

Code:
=AND(ProfieldC[ErectDate]<=DATE(2014,1,31),OR(ISBLANK([DismantleDate]),ProfieldC[DismantleDate]>DATE(2014,1,31))))

giving TRUE or FALSE, or

Code:
=(AND(ProfieldC[ErectDate]<=DATE(2014,1,31),OR(ISBLANK([DismantleDate]),ProfieldC[DismantleDate]>DATE(2014,1,31))))*1

giving 1 or 0.

And the Mar test would be

Code:
=AND(ProfieldC[ErectDate]<=DATE(2014,1,31),OR(ISBLANK([DismantleDate]),ProfieldC[DismantleDate]>DATE(2014,1,31))))

or

Code:
=(AND(ProfieldC[ErectDate]<=DATE(2014,3,31),OR(ISBLANK([DismantleDate]),ProfieldC[DismantleDate]>DATE(2014,3,31))))*1
 
Upvote 0
Bardd,

Tested the 2nd, line. Looks like this worked. This helps to verify that the correct rows are being captured.

Can this original formula be converted to the original request, which was this :


Code:
=SUMPRODUCT((I2:I2<=$AO$1)*(((J2:J2="")+(J2:J2>=$AO$1)>=1)))

Might look something like this based on your help above:

Code:
=SUMPRODUCT((ProfieldC[ErectDate]<=DATE(2014,1,31)*(((ISBLANK[DismantleDate)+(ProfieldC[DismantleDate]>=DATE(2014,1,31)>=1)))



Thank you for your help. Your time is appreciated,

Frankee
 
Last edited:
Upvote 0
Bardd,

I just figured out why I'm getting too many rows back. I left out important item: [ActivityType]="Erect" how can this be added. I tried but I got error:

Code:
=(AND(ProfieldW[ErectDate]<=DATE(2014,1,31),AND(ProfieldW[ActivityType]="Erect"),OR(ISBLANK([DismantleDate]),ProfieldW[DismantleDate]>DATE(2014,1,31))))*1


Thanks for your time,

Frankee Gee.
 
Upvote 0

Forum statistics

Threads
1,223,992
Messages
6,175,834
Members
452,674
Latest member
psion2600

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