Good afternoon,
I am trying to compare that a date is equal to an exact value but despite being it returns a false. Do you have any solutions?
=IF(AI14=31/12/9999;TRUE;FALSE)
=IF(AI14="31/12/9999";TRUE;FALSE)
The value is in a pivot table, is a problem?
Thanks
This might be due to comparing different types of data (string vs numeric which will therefore be unequal and return FALSE). Convert them to the same type & retry (i.e. numeric date == numeric date).
Related
Using PowerPivot functionality to create measures.
There are two types of values in a column: integers and NULL (string).
Trying to figure out how to create a DAX formula to calculate an average for the column that would take only cells that contain integers.
It feels that the next basic formula would work:
=CALCULATE (
AVERAGE ( tData[columnA]),
FILTER ( tData, [columnA] <> "NULL" )
)
but it throws an error: The function AVERAGE takes an argument that evaluates to numbers or dates and cannot work with values of type String.
I'm wondering if there is a way to avoid this error without removing/cleaning NULLs values beforehand?
Power BI tables cannot contain mixed types of values in a single column. If there is numbers and texts in a column, the column type is text. Numeric values included in the column is not actually numbers, they are just texts composed of numeric characters.
So, in order to make it work, you need to explicitly convert numeric strings to real numbers.
= CALCULATE(
AVERAGEX( tData[columnA], VALUE(tData[columnA]) ),
tData[columnA] <> "NULL"
)
However, I suggest not to have text and numeric values in one column. Use Power Query to either remove rows with "NULL", or convert them to BLANK.
Best way here would if you replace your NULL (string) values with the database null (nothing) value. This way your rows stay null but your calculation still works.
Go to Edit Queries > Transform > Repalce Values and replace your string NULL to a database null. Your table will look like this then:
Now the avarage calcualtion is simple:
Database null values get ignored from every calculations. This is way it works.
i have some cells d1:d10. Some have numbers, others contain "". The "" is the result of an =iferror(,"") function to leave a blank cell.
I am trying to average d1:d10 but only including the cells that are not "".
I have =AVERAGE(IF(D12:D51<>"",D12:D51)) followed by ctrl+shft+enter but it is still taking the average of all the cells (essentially taking the sum and dividing by 10, where I want it to take the sum and divide by less than 10 depending on the number of "" cells)
I couldn't reproduce your problem in Excel 2013.
Normally, Excel's average function ignores text, empty cells and logical values. So, the following formula should do what you are trying to do.
=AVERAGE(D1:D10)
The if clause in your function returns either some numbers or FALSE. Again, normally, Excel's average function ignores FALSE values so it shouldn't behave like you said. If it somehow is converting boolean values to numeric values based on Excel's version (FALSE to zero) you can just give a string instead of a boolean value so it has to ignore those values:
=AVERAGE(IF(D1:D10<>"", D1:D10, "s"))
Alternatively you can calculate the average without the average function:
=SUM(IF(D1:D10<>"", D1:D10))/COUNT(IF(D1:D10<>"", D1:D10))
I'm trying to match a date against an array. However, I notice my date is evaluated as an integer.
Instead of =MATCH(20/02/2014;B1:B21;1) it becomes =MATCH(41690;B1:B21;1); and I'm getting an #N/A as a result!
How to get this rectified?
Thanks!
Make sure that dates in your lookup column are actually dates (i.e. 5-digit decimal values in fact, but not text).
Use a formula like this:
=MATCH(DATE(2014,2,20),B1:B21,1)
This is because your lookup range is not formatted as Date, because in whatever format you write a date (dd/mm/yy or mm/dd/yy or yy/dd/mm) dates should match if written as date.
I am importing into excel timestamps in the format YYYY-MM-DD HH:MM:SS.sss into column A of a new spreadsheet. I am trying to calculate the difference between two times.
So in column B I have the formula =RIGHT(A1,6) which gets the SS.sss value. In Column C I am taking the values away from each other - =B2-B1. This correctly calculates the gap between the two values.
What I want to do now, is create an IF statement =IF(C2<>0.02,"","Error"), to determine if the time gap is not the value is it supposed to be.
The problem is, that this IF statement always is evaluated as Error instead of the blank cell, even if the value in column C is 0.02.
Does anyone know why this might be happening?
Maybe you're comparing text 0.02 with value 0.02? Try:
=IF(VALUE(C2)<>0.02,"","Error")
The test in =IF(C2<>0.02,"","Error") with C2=0.02 evaluates to FALSE (ie C2 DOES equal 0.02), so 'of course' the third parameter is returned. I suspect you may want =IF(C2=0.02,"","Error").
I have a column with =IF(E2="W ",H2,IF(I2<>"",I2,"")) in it.
It displays values but when I take an average of the column, it comes up with a divide by zero error.
Is there a special type of average function I need to use for this?
I assume that H2 and/or I2 are numbers? Perhaps those numbers are text formatted (in which case AVERAGE, not finding any true numbers will return #DIV/0! error). Try converting like this:
=IF(E2="W ",H2+0,IF(I2<>"",I2+0,""))
+0 will convert a text-formatted number to an actual number, then your AVERAGE function should work