I am trying to get the values with wildcard in Cubevalue formula(below) in excel. I am not finding any solution.
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Sum of Bookings_Net]","[Dashboard_Data].[Level_1].[Karnataka_India]")
I am trying to get the values where [level 1] ends with [_India], I don't want to create a calculated Column in Data Model as this condition may be used for different columns and different conditions.
I have also tried by giving cell reference(eg-[Cell A1] = "_India) as like below but I am not able to get the results.
CUBEVALUE("ThisWorkbookDataModel","[Measures].[Sum of Bookings_Net]","[Dashboard_Data].[Level_1].["&A$1&"]")
kindly help me to overcome this issue.
First create a =CUBESET function in cell A1.
=CUBESET("ThisWorkbookDataModel","Filter([Dashboard_Data].[Level_1].[Level_1].Members, Right([Dashboard_Data].[Level_1].CurrentMember.Name, 6)=""_India"")")
Basically that is a language called MDX and the expression before "" double quote escaping is:
Filter([Dashboard_Data].[Level_1].[Level_1].Members, Right([Dashboard_Data].[Level_1].CurrentMember.Name, 6)="_India")
Then reference it in your =CUBEVALUE formula:
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Sum of Bookings_Net]",$A$1)
Related
Is it possible to use the DATEVALUE function inside a vlookup?
I am trying to lookup a date in a separate sheet but the date is formatted as string so I'd like to use the DATEVALUE function to convert it.
I have played around with putting the datevalue in a few different positions within the vlookup but no luck.
Any help would be greatly appreciated!
Here/screenshot(s) refer -
Of course you can- you just need to know how vlookup works and manipulate accordingly - I provide the solution you have specifically requested, together with 2 other possible ways of looking up without 'parsing to date format' in first instance:
Revision : see here for how to input array formula for different versions of Excel - these are otherwise valid for both 2010/Office 365 compatible version of Excel.
1] Vlookup
=VLOOKUP(G4,IFERROR(DATEVALUE(C4:D6),D4:D6),2,0)
Unlike other lookup functions (e.g. M2-M3, offset etc.) vlookup cannot be used as a reference itself - it requires the entire range to be included and then 'pivots' on the first column. This is why you can lookup datevalue of the single column which contains valid text formatted dates, but once you reference a larger range, datevalue(larger range) will return errors for any value in that range which cannot be converted to a date. Hence the iferror component.
I suspect the fundamental goal is to return the cell corresponding to the datevalue of the text you're looking up - you couldn't be fussed whether it's a vlookup or any other form of lookup. Here are two other methods to achieve this objective:
2] Sum
=SUM(1*(DATEVALUE(C4:C6)=G4)*(D4:D6))
(Uncommon, albeit parsimonious lookup tool)
3] Index
=INDEX(D4:D6,MATCH(G4,DATEVALUE(C4:C6),0))
Closing remarks
Index is typically preferable to vlookup, given the advantage of being able to be used as a reference itself (e.g. you could have offset(index<>) but not offset(vlookup<>)) - this is why index can lookup columns to the left/right of the lookup column (vlookup works to the right only). The only advantage vlookup() has is the approximate search function (final parameter = True to enable). Xlookup() is more versatile; offset() is another 'special / honorary' mention which I have not provided examples for - but also feasible (albeit the latter is has negative stigma associated due to its volatile nature - but that's for another post!)
I need to implement the following formula to get the desired result ($32.000 instead of $96.000) - as from cell C3 (see picture)
=IF(ISNUMBER(SEARCH("Assets",INDEX(F:F,MATCH(B3,G:G,0)))),1,-1)*SUMIFS(H:H,G:G,B3)
The issue is that the formula sets the sign (+ or -) for the whole formula based on the first parameter it founds ("+" for "Assets" ; "-" for "Liabilities") when it should treat them independently and sum them accordingly.
I've managed to get the result using the "Account"'s parameters (besides the "Ledger Account"'s) as external criteria, but that's something I'd like to avoid.
=SUMIFS($G:$G;$F:$F;B3;$E:$E;E3)-SUMIFS($G:$G;$F:$F;B3;$E:$E;E4)
I think you've got something that works with that second formula. Stringing together a few sumifs is a simple way of solving this:
=SUMIFS(G:G,F:F,B3,E:E,"*assets")+SUMIFS(G:G,F:F,B3,E:E,"*revenues")-SUMIFS(G:G,F:F,B3,E:E,"*liabilities")-SUMIFS(G:G,F:F,B3,E:E,"*costs")
Main Problem statement : To retrieve multiple matches in excel.
I have 3 columns starting from AD to AF.AD has multiple matches.I need to retrieve AF values for matched AD value.
I searched on net and got the below formula.
=IFERROR(INDEX($B$3:$B$13,SMALL(IF(D$2=$A$3:$A$13,ROW($A$3:$A$13)- MIN(ROW($A$3:$A$13))+1,""), ROW()-2)),"")
But I am trying to implement my own solution.I am trying to use MATCH function as range in VLOOKUP function.Then change the range of MATCH function to retrieve 2nd match and so on.Continue this until there is no match found.
Here is what I tried which is giving an #NAME error.
=VLOOKUP(AD3,AD&EVAL("=MATCH(AD3,AD:AD,0)"):AF1000,3,0)
Also,it would be very appreciated if there is another solution to the main problem statement.
If this is the right direction to proceed,please help to complete this formula.
Thanks.
Main Problem statement : To retrieve multiple matches in excel.
Now I have to get multiple matches and compare them if they are equal.
You seem to have an XY Problem. You are concentrating on resolving the first half of your formula problem while ignoring a simpler solution that would resolve the entire task.
=and(countif(ad:ad, ad3)=countifs(ad:ad, ad3, af:af, af3))
True if all related values in column AF where column AD is equal to AD3 are the same; false if column AF contains differing values.
I've been reading a bunch of answers around nesting if/then statements in Excel but I can't figure out how to fix a "formula parse error" in mine. From what I can tell and in my code editor the formula is correct. Any ideas what I'm missing here?
I have a row of cells that auto-generate a number 1-35 based on other values. I want the cell with the formula to pull data from another row based on what's the in row of numbers 1-35. It works when I test one at a time; it's the nesting that is causing the errors. Thanks!
=IF(E$167=1,C56,IF(E$167=2,D56,IF(E$167=3,E56,IF(E$167=4,F56,IF(E$167=5,G56,IF(E$167=6,H56,IF(E$167=7,I56,IF(E$167=8,J56,IF(E$167=9,K56,IF(E$167=10,L56,IF(E$167=11,M56,IF(E$167=12,N56,IF(E$167=13,O56,IF(E$167=14,P56,IF(E$167=15,Q56,IF(E$167=16,R56,IF(E$167=17,S56,IF(E$167=18,T56,IF(E$167=19,U56,IF(E$167=20,V56,IF(E$167=21,W56,IF(E$167=22,X56,IF(E$167=23,Y56,IF(E$167=24,Z56,IF(E$167=25,AA56,IF(E$167=26,AB56,IF(E$167=27,AC56,IF(E$167=28,AD56,IF(E$167=29,AE56,IF(E$167=30,AF56,IF(E$167=31,AG56,IF(E$167=32,AH56,IF(E$167=33,AI56,IF(E$167=34,AJ56,IF(E$167=35,AK56,””)))))))))))))))))))))))))))))))))))
You might have run into a function nesting limit. Try the choose function to work around it.
How about using
=IF(AND(E167>0,E167<36),OFFSET(B56,0,E167),"")
Note : OFFSET is a volatile function, see this for details.
A simple vlookup or hlookup function can do exactly what you need without righting long nested if statement.
for example you can use:
=vlookup(E$167,$A1:$B35,2,false) where $A1:$B35 is the table array containing column A (1-35) and column B its corresponding value.
I would like to create a succinct Excel formula that SUMS a column based on a set of AND conditions, plus a set of OR conditions.
My Excel table contains the following data and I used defined names for the columns.
Quote_Value (Worksheet!$A:$A) holds an accounting value.
Days_To_Close (Worksheet!$B:$B) contains a formula that results in a number.
Salesman (Worksheet!$C:$C) contains text and is a name.
Quote_Month (Worksheet!$D:$D) contains a formula (=TEXT(Worksheet!$E:$E,"mmm-yy"))to convert a date/time number from another column into a text based month reference.
I want to SUM Quote_Value if Salesman equals JBloggs and Days_To_Close is equal to or less than 90 and Quote_Month is equal to one of the following (Oct-13, Nov-13, or Dec-13).
At the moment, I've got this to work but it includes a lot of repetition, which I don't think I need.
=SUM(SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Oct-13")+SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Nov-13")+SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Dec-13"))
What I'd like to do is something more like the following but I can't work out the correct syntax:
=SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,OR(Quote_Month="Oct-13",Quote_Month="Nov-13",Quote_Month="Dec-13"))
That formula doesn't error, it just returns a 0 value. Yet if I manually examine the data, that's not correct. I even tried using TRIM(Quote_Month) to make sure that spaces hadn't crept into the data but the fact that my extended SUM formula works indicates that the data is OK and that it's a syntax issue. Can anybody steer me in the right direction?
You can use SUMIFS like this
=SUM(SUMIFS(Quote_Value,Salesman,"JBloggs",Days_To_Close,"<=90",Quote_Month,{"Oct-13","Nov-13","Dec-13"}))
The SUMIFS function will return an "array" of 3 values (one total each for "Oct-13", "Nov-13" and "Dec-13"), so you need SUM to sum that array and give you the final result.
Be careful with this syntax, you can only have at most two criteria within the formula with "OR" conditions...and if there are two then in one you must separate the criteria with commas, in the other with semi-colons.
If you need more you might use SUMPRODUCT with MATCH, e.g. in your case
=SUMPRODUCT(Quote_Value,(Salesman="JBloggs")*(Days_To_Close<=90)*ISNUMBER(MATCH(Quote_Month,{"Oct-13","Nov-13","Dec-13"},0)))
In that version you can add any number of "OR" criteria using ISNUMBER/MATCH
You can use DSUM, which will be more flexible. Like if you want to change the name of Salesman or the Quote Month, you need not change the formula, but only some criteria cells. Please see the link below for details...Even the criteria can be formula to copied from other sheets
http://office.microsoft.com/en-us/excel-help/dsum-function-HP010342460.aspx?CTT=1
You might consider referencing the actual date/time in the source column for Quote_Month, then you could transform your OR into a couple of ANDs, something like (assuing the date's in something I've chosen to call Quote_Date)
=SUMIFS(Quote_Value,"<=90",Quote_Date,">="&DATE(2013,11,1),Quote_Date,"<="&DATE(2013,12,31),Salesman,"=JBloggs",Days_To_Close)
(I moved the interesting conditions to the front).
This approach works here because that "OR" condition is actually specifying a date range - it might not work in other cases.
Quote_Month (Worksheet!$D:$D) contains a formula (=TEXT(Worksheet!$E:$E,"mmm-yy"))to convert a date/time number from another column into a text based month reference.
You can use OR by adding + in Sumproduct. See this
=SUMPRODUCT((Quote_Value)*(Salesman="JBloggs")*(Days_To_Close<=90)*((Quote_Month="Cond1")+(Quote_Month="Cond2")+(Quote_Month="Cond3")))
ScreenShot
Speed
SUMPRODUCT is faster than SUM arrays, i.e. having {} arrays in the SUM function. SUMIFS is 30% faster than SUMPRODUCT.
{SUM(SUMIFS({}))} vs SUMPRODUCT(SUMIFS({})) both works fine, but SUMPRODUCT feels a bit easier to write without the CTRL-SHIFT-ENTER to create the {}.
Preference
I personally prefer writing SUMPRODUCT(--(ISNUMBER(MATCH(...)))) over SUMPRODUCT(SUMIFS({})) for multiple criteria.
However, if you have a drop-down menu where you want to select specific characteristics or all, SUMPRODUCT(SUMIFS()), is the only way to go. (as for selecting "all", the value should enter in "<>" + "Whatever word you want as long as it's not part of the specific characteristics".
In order to get the formula to work place the cursor inside the formula and press ctr+shift+enter and then it will work!
With the following, it is easy to link the Cell address...
=SUM(SUMIFS(FAGLL03!$I$4:$I$1048576,FAGLL03!$A$4:$A$1048576,">="&INDIRECT("A"&ROW()),FAGLL03!$A$4:$A$1048576,"<="&INDIRECT("B"&ROW()),FAGLL03!$Q$4:$Q$1048576,E$2))
Can use address / substitute / Column functions as required to use Cell addresses in full DYNAMIC.