Complie error: Expected Separator or ) - excel

I'm attempting to make a macro to insert a formula into a cell range that references a table on the page, but I'm getting the compile error. Can anyone give me a hand with this? It doesn't seem to like that I'm referencing a Table (or the #Duration part anyways, but this is necessary). I basically just need it to drop this formula string into the required cells.
Code:
Range("A2:A100").Formula = MID(Table4[#Duration],FIND("m",Table4[#Duration],1)-1,7)
Thanks.

the formula needs to be in quotes:
Range("A2:A100").Formula = "=MID(Table4[#Duration],FIND(""m"",Table4[#Duration],1)-1,7)"

Related

Data validation using selected rows and not a whole range of values

Currently i'm doing a data validation using the range !$A$4:$A$76 and all is working great.
However, i'm trying to add something different, which is doing a data validation on the selected lines within that range. For example, instead of select all the lines between !$A$4:$A$76, i want to select A$11, A$22, A$31, A$55, A$59, A$60, A$70, A$71, A$72, A$75.
The method i was doing gave me an error in the data validation step, as long as it said: ' The source must be a delimited list or a reference to a single row or column '.
Can someone help me on this one?
Thanks for the help,
Anna
What you are trying to do is not strictly possible. A workaround I would suggest is to use another range (perhaps on a hidden sheet) to reference the cells where the validation source is by using direct reference formulas. For example, in cell G1 you would write:
=$A$11
Then in Cell G2 you would write:
=$A$22
etc... then use the range G1:G10 as the source for your data validation list.

Nested if/then statement syntax

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.

Excel Vlookup , too few arguments error

When I try to enter Vlookup formula manually in Excel, I get the following error;
excel manual vlookup error. This error appears while I'm defining the second element of the formula from another excel file and it doesn't let me to define the area.And it directs me to use formula wizard, however it's not useful and efficient for me. Has anyone experienced this problem before?
You may find the formula I try to use as below;
=vlookup(S2;'[Copy of Material Master_S112.xlsx]q_S112'!$G$2:$I$7
after this point it doesn'let me to make any change and directs me to formula wizard.
Thank you for your help in advance
VLOOKUP() takes 4 arguments:
Value to seek.
Target range.
Number of result column relative to the first column of target range. E.g. if your target range is $G:$I and you need results from column H this parameter should be 2, if you want results from column I - then 3.
Parameter specifying whether you need exact (TRUE) or approximate (FALSE) match. Set it to FALSE in most cases.
And of course you need closing parenthesis ) at the end.
So the correct formula should look something like this:
=VLOOKUP(S2;'[Copy of Material Master_S112.xlsx]q_S112'!$G$2:$I$7;3;FALSE)
If you use Ctrl-Shift-Down after you have started to enter the second parameter you will get the "you have entered too few arguments" message.
You can only use Ctrl-Shift-Down after selecting a cell but before you have entered anything for the second VLOOKUP parameter.
As I mentioned in my comment, arguments in Excel formulas are separated by commas, not semicolons.
For example,
=VLOOKUP(S2, '[Copy of Material Master_S112.xlsx]q_S112'!$G$2:$I$7, 2, FALSE)
Thank you for all your answers. It's kind of interesting but, I have to hit at first shift and then control not to get this error. It wasn't like that before but when I hit control first and then shift+down it gives the error. But at least it works like this.
if you use win 10 , you must change the regoin configoration .
in control panel > region >formats> additional setting> list separator
change content to ";"

How to use wildcard in Cubevalue formula in Excel?

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)

How do I replace the argument in countif in a static formula with a word or result of a formula on another sheet

I am trying to replace this static formula
=COUNTIFS(GPS!$J:$J,"Create Order List*",GPS!$D:$D,ScoreCard!$B16)
with something like this
=COUNTIFS(GPS!$J:$J,=CELL("contents",Task!F9),GPS!$D:$D,ScoreCard!$B16)
or
=COUNTIFS(GPS!$J:$J,=Task!F9,GPS!$D:$D,ScoreCard!$B16)
I have also tried =Text etc.
where Task!F9 is a cell where "Create Order List*" is typed in on the TASK sheet.
the 123 Derivative #CELL("contents") had no such problem doing this successfully in 123. I need the dynamic ability to have the formula manipulated via a reference to the task page. I have tried it without the = sign in front of the cell and with a + instead . Help would be appreciated.
Please try:
=COUNTIFS(GPS!$J:$J,Task!F$9&"*",GPS!$D:$D,Scorecard!$B16)
Assumes Task!F$9 contains Create Order List.

Resources