"Text" in formula in PowerPivot

nielf

Board Regular
Joined
Nov 13, 2012
Messages
69
Hi,

I'm trying to merge two date columns into one depending on status.

When the status in column A is either "Awarded" or "Closed" the date from colum B will be used. When the status in column A is "Lost" the date from column C will be used.

I have created the formula in Excel and it works as supposed.

=IF(A2="Awarded";B2;IF(A2="Closed";B2;IF(A2="Lost";C2;"")))

Sqpc1Ut.png


However, now I would like to use the same formula in PowerPivot but it seems that it isn't possible as I get the error below:

1QoxZnK.png


My formula in PowerPivot looks like this:

=IF(Data[StatusToBe]="Awarded",Data[Awarded Date],IF(Data[StatusToBe]="Closed",Data[Awarded Date],IF(Data[StatusToBe]="Lost",Data[Status Change Date],"")))

Is it not allowed to refer to "text" in PowerPivot formulas? If so, is there any other way I can re-create the formula in PowerPivot to get it working?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I think the issue is that the results of an if statement must always be of the same type. The first 2 return a date, and the third returns a text. Try replacing the third returned value "" with BLANK()
 
Upvote 0
I think the issue is that the results of an if statement must always be of the same type. The first 2 return a date, and the third returns a text. Try replacing the third returned value "" with BLANK()

You are right, Matt. Thank you very much for the reply. It's very much appreciated!
 
Upvote 0
The last value is optional and the default is blank. So you can also omit the last comma and the blank() function, and it should still work.
 
Upvote 0

Forum statistics

Threads
1,224,118
Messages
6,176,485
Members
452,730
Latest member
palsmith

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