I need help in proper formula formatting/syntax. I just haven’t been able to debug my formula to calculate a Median. Here is a working formula that calculates an Average:
=AVERAGEIFS(OFFSET(INDEX(date_city!1:1,MATCH("Price Per SF",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Price Per SF",date_city!1:1,FALSE))),1), (OFFSET(INDEX(date_city!1:1,MATCH("Date of Sale",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Date of Sale",date_city!1:1,FALSE))),1)), ">" & Criteria!$F$4, (OFFSET(INDEX(date_city!1:1,MATCH("Date of Sale",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Date of Sale",date_city!1:1,FALSE))),1)), "<" & Criteria!$G$4)
I need to modify the above so it calculates a Median.
I’ve tested this simpler formula for proper format and it works:
{=MEDIAN(IF((date_city!$I$2:$I$989>Criteria!$F$4)*(date_city!$I$2:$I$989<Criteria!$G$4),
date_city!$E$2:$E$221))}
I need to replace *date_city!$I$2:$I$989* and *date_city!$E$2:$E$221* from the above Median formula with their corresponding code from the Average formula.
I tried this code, but cannot find my errors. Probably incorrect parantheses or comma placement.
=MEDIAN(IF((OFFSET(INDEX(date_city!1:1,MATCH("Date of Sale",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Date of Sale",date_city!1:1,FALSE))),1)) ">" & Criteria!$F$4)*(OFFSET(INDEX(date_city!1:1,MATCH("Date of Sale",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Date of Sale",date_city!1:1,FALSE))),1)) "<" & Criteria!$G$4), OFFSET(INDEX(date_city!1:1,MATCH("Price Per SF",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Price Per SF",date_city!1:1,FALSE))),1)
Thanks in advance for any help.
FormulaDesk can display your formula in a way that is very easy and quick to understand, rolling-up nested parts together with their results. It should also pinpoint exactly where the error is.
[Disclosure: I am the author of FormulaDesk]
Related
I have no idea what to put in the formula box, and the help (https://support.microsoft.com/en-us/office/create-a-measure-in-power-pivot-d3cc1495-b4e5-48e7-ba98-163022a71198?ns=excel&version=90&syslcid=1033&uilcid=1033&appver=zxl900&helpid=149601&ui=en-us&rs=en-us&ad=us) says simple enter a formula.
Is there any documentation?
Neither
=SUM(dsv_FactIncome[ClientValue], dsv_FactIncome[PartnerValue])
nor
=SUMX(dsv_FactIncome[ClientValue], dsv_FactIncome[PartnerValue])
are acceptable to it, either.
This is DAX and your syntax is incorrect. Try
=SUM(dsv_FactIncome[ClientValue]) + SUM(dsv_FactIncome[PartnerValue])
I have a sheet where we paste values copied from a pdf into a column, such as:
2715411.0 28.10.2021 600.00
In Google sheets there are columns with formulas that split these values, one of each is:
=ArrayFormula(INDEX(SPLIT(REGEXREPLACE(C2:C274, "\s", "♥"),"♥"),ROW(C2)-ROW(C2),1))
This formula is returning "2715411" instead of "2715411.0". I've tested the formula if the value was "2715411.1" and it works so I'm assuming it's because the number is being "rounded".
Another thing to take into consideration is that sometimes the number we paste is something like "32434346 28.10.2021 600.00" so having always decimal places can't be the answer.
Can anyone help?
Thank you in advance.
=ArrayFormula(SUBSTITUTE(SPLIT(SUBSTITUTE(C2:C274,".","♦")," "),"♦","."))
I've managed to format the following lines in XPath, from this format:
1000.50
30
to this:
100050
3000
The solution I've adopted is:
concat(substring-before([number], '.'), substring-after([number], '.'))
If the . is not present I directly multiply the number by 100.
I'm wondering if there is any better way to do that. My second thought was using Java.
What goes wrong if you just multiply by 100? So long as the result of multiplying by 100 is an exact integer, it should be formatted without a "." when converted to a string. If there are rounding errors that mean the result is not an exact integer, you might want to use round().
The concat() approach seems fragile to me: what if someone gives you input like 1000.5 or perhaps 1000.500?
I'm currently struggling on finding the formula that will resolve my problem.
Here's the status quo:
In Sheet 1, column A, I have a set of string, such as:
/search.action?gender=men&brand=10177&tag=10203&tag=10336
/search.action?gender=women&brand=11579&tag=10001&tag=10138
/search.action?gender=men&brand=12815&tag=10203&tag=10299
/search.action?gender=women&brand=1396&tag=10203&tag=10513
/search.action?gender=women&brand=11&tag=10001&tag=10073
/search.action?gender=women&brand=1396&tag=10203&tag=10336
/search.action?gender=women&brand=13
In Sheet 2, column A, I have a set of strings such as:
brand=10177
brand=12815
brand=13
brand=1396
brand=11579
Finally, in sheet 1, column B will be my "filter" with the formula I'm struggling to find. The goal of my formula is to detect in any of the strings in sheet 1 if one of the string in sheet 2 is present (as an exact match!). Indeed, now it only finds approximative matches. As you can see, the row 5 shouldn't return anything. But with my current formula it does.
Here's the formula:
{=IFERROR(INDEX('Sheet 2'!$A$1:$A$5;MATCH(1;COUNTIF(A1;"*"&'Sheet 2'!$A$1:$A$5&"*");0));"")}
Any idea on the matter?
Please note that I don't want to use VBA, macros, but only a formula.
Thanks a lot for your help!
Following will solve your problem I guess:
=VLOOKUP(MID(A2,FIND("&",A2)+1,FIND("&",A2,FIND("&",A2)+1)-FIND("&",A2)-1),Sheet2!A:A,1,FALSE)
Basically with find function I have identified the start and length of the string in between "&" signs. and used in vlookup.
Another point to mention is this formula is only looking for the first 2 "&" signs.
For completeness, here is another solution based on this answer
=INDEX(Sheet2!$A$1:$A$5,MAX(IF(ISERROR(FIND(Sheet2!$A$1:$A$5,A1)),-1,1)*(ROW(Sheet2!$A$1:$A$5)-ROW(Sheet2!$A$1)+1)))
This is a bit more general and it doesn't matter how many search tags there are.
However as it stands it would match brand=13 in the second sheet with brand=1396 in the first sheet. To avoid that you could add an ampersand to the search strings:-
=INDEX(Sheet2!$A$1:$A$5,MAX(IF(ISERROR(FIND(Sheet2!$A$1:$A$5&"&",A1&"&")),-1,1)*(ROW(Sheet2!$A$1:$A$5)-ROW(Sheet2!$A$1)+1)))
This formula throws a #VALUE error if there is no match: to avoid this, you would need to put an IFERROR statement round it:-
=IFERROR(INDEX(Sheet2!$A$1:$A$5,MAX(IF(ISERROR(FIND(Sheet2!$A$1:$A$5&"&",A1&"&")),-1,1)*(ROW(Sheet2!$A$1:$A$5)-ROW(Sheet2!$A$1)+1))),"")
All these are array formulae.
I'd like to calculate the standard deviation over two fields from the same dataset.
example:
MyFields1 = 10, 10
MyFields2 = 20
What I want now, is the standard deviation for (10,10,20), the expected result is 4.7
In SSRS I'd like to have something like this:
=StDevP(Fields!MyField1.Value + Fields!MyField2.Value)
Unfortunately this isn't possible, since (Fields!MyField1.Value + Fields!MyField2.Value) returns a single value and not a list of values. Is there no way to combine two fields from the same dataset into some kind of temporary dataset?
The only solutions I have are:
To create a new Dataset that contains all values from both fields. But this is very annoying because I need about twenty of those and I have six report parameters that need to filter every query. => It's probably getting very slow and annoying to maintain.
Write the formula by hand. But I don't really know how yet. StDevP is not that trivial to me. This is how I did it with Avg which is mathematically simpler:
=(SUM(Fields!MyField1.Value)+SUM(Fields!MyField2.Value))/2
found here: http://social.msdn.microsoft.com/Forums/is/sqlreportingservices/thread/7ff43716-2529-4240-a84d-42ada929020e
Btw. I know that it's odd to make such a calculation, but this is what my customer wants and I have to deliver somehow.
Thanks for any help.
CTDevP is standard deviation.
Such expression works fine for me
=StDevP(Fields!MyField1.Value + Fields!MyField2.Value) but it's deviation from one value (Fields!MyField1.Value + Fields!MyField2.Value) which is always 0.
you can look here for formula:
standard deviation (wiki)
I believe that you need to calculate this for some group (or full dataset), to do this you need set in the CTDevP your scope:
=StDevP(Fields!MyField1.Value + Fields!MyField2.Value, "MyDataSet1")