Column validation in Sharepoint's list - sharepoint

I am new to Sharepoint. I want to create a validation rule in column validation to validate the given email address. Here is my code:
=AND(
ISERROR(FIND(” “, [Email],1)),
IF(ISERROR(FIND(“#”, [Email],2)),
FALSE,
AND(
ISERROR(FIND(“#”,[Email], FIND(“#”, [Email],2)+1)),
IF(ISERROR(FIND(“.”, [Email], FIND(“#”, [Email],2)+2)),
FALSE,
FIND(“.”, [Email], FIND(“#”, [Email],2)+2) < LEN([Email])
)
)
)
)
but the "ISERROR" function does not work and i get a syntax error. My column name is: Email and the type is: Single line of text

Per test, your code works fine on my environment.
Please make sure one thing: please use double quotes with English characters in the validation. It should be "" instead of “”.
=AND(
ISERROR(FIND(" ", [Email],1)),
IF(ISERROR(FIND("#", [Email],2)),
FALSE,
AND(
ISERROR(FIND("#",[Email], FIND("#", [Email],2)+1)),
IF(ISERROR(FIND(".", [Email], FIND("#", [Email],2)+2)),
FALSE,
FIND(".", [Email], FIND("#", [Email],2)+2) < LEN([Email])
)
)
)
)

Related

How do you combine IF, AND and NOT statements in Microsoft excel

I'm trying to compare Column A and Column B with Column C and Column D and display the results in Column E as shown in the table below using the following formula:
=IF(NOT(IF(AND(A2=C2,B2=D2),"Names Correct","Names Not Correct")),AND(NOT(A2=C2),B2=D2),"Car Worng, Driver Correct", "Car Correct, Driver Wrong")
But I get the error when I press enter:
You've Entered too many arguments for this function
Can someone please point out what I'm doing wrong. Thanks.
Eidt: forgot to include table.
If you indent your code, you'll see that it doesnt really match up.
=IF(
NOT(
IF(
AND(
A2=C2,
B2=D2
),
"Names Correct",
"Names Not Correct"
)
),
AND(
NOT(
A3=C3
),
B3=D3
),
"Car Worng, Driver Correct",
"Car Correct, Driver Wrong"
)
You have a IF(NOT, AND, value1, value2) at the top level.
I dont know what your goal was, but hopefully this helps you solve it.
There's no need to use NOT, the required result can be achieved using nested IF statements and the AND function
=IF(AND(A2=C2,B2=D2),"Names Correct",IF(AND(A2=C2,B2<>D2),"Car Correct, Driver Wrong",IF(AND(A2<>C2,B2=D2),"Car Wrong , Driver Correct","Names Not Correct")))
Or formatted a bit better.
=IF(AND(A2=C2,B2=D2),"Names Correct",
IF(AND(A2=C2,B2<>D2),"Car Correct, Driver Wrong",
IF(AND(A2<>C2,B2=D2),"Car Wrong , Driver Correct",
"Names Not Correct")))

GI - Conditional Result Column

I am trying to do a conditional statement that displays the inventory items that contain w3 in the ID. I then need to use the same GI and create another column that displays the inventory item that contains FG in the INV ID.
I have tried this expression without any success:
=IIf( 'w3' In [left(inventoryCD,2)], inventoryCD, null )
=IIf( 'FG' In [left(inventoryCD,2)], inventoryCD, null )
Try to use InStr instead of In operator. Here is example above:
=IIf(InStr(Left(InventoryCD,2),'w3')>0, InventoryCD, null )
=IIf(InStr(Left(InventoryCD,2),'FG')>0, InventoryCD, null )

Formula keeps saying that there are too many arguments?

=IF(
( AND(
'Subject Teachers'!X4 <> "",
'Subject Teachers'!T4 >= 70
) ),
'Subject Teachers'!T4,
'Subject Teachers'!R4,
IF(
( AND(
'Subject Teachers'!R4 <> "",
'Subject Teachers'!O4 >= 70
) ),
'Subject Teachers'!O4,
'Subject Teachers'!L4,
IF(
( AND(
'Subject Teachers'!L4 <> "",
'Subject Teachers'!I4 >= 70
) ),
'Subject Teachers'!I4,
"N/A"
)
)
)
You have to many in the first IF statement. an if statement has 3 sections. The test, result if true and result if false. Your statement continues after the result is false.
Generic if statement example:
if(, , )
You have added an and statement in the . That goes from AND('Subject Teachers'!X4<>"",'Subject Teachers'!T4>=70)). So if x4 is not blank and t4 is greater than or equal to 70 then true else fase. Your statement has if the and statement is true then make it equal the value in 'Subject Teachers'!T4.
However if it is false make it equal to 'Subject Teachers'!T4. That should be the end. However you have another if statement beginning.
Depending what you are trying to do you should place the next if statement in the true section or the false section.
You can make your formula "work" by removing the "else/otherwise" results from the first two IFs, like this:
=IF(AND('Subject Teachers'!X4<>"",'Subject Teachers'!T4>=70),'Subject Teachers'!T4,IF(AND('Subject Teachers'!R4<>"",'Subject Teachers'!O4>=70),'Subject Teachers'!O4,IF(AND('Subject Teachers'!L4<>"",'Subject Teachers'!I4>=70),'Subject Teachers'!I4,"N/A")))
That removes the results L4 and R4.
The original formula is impossible because it says, for example, "if X then do THIS, otherwise do THIS, and if Y then do THIS, otherwise do THIS, and if Z then do THIS, otherwise do THIS". See, there are three results from that statement - it can't return a single answer. A typical nested IF formula goes "if X then do THIS, otherwise if Y then do THIS, otherwise if Z then do THIS, otherwise do THIS". That's what the edited formula above does.
Alternatively, if you do want all three results then you can nest the results together, like this:
=IF(AND('Subject Teachers'!X4<>"",'Subject Teachers'!T4>=70),'Subject Teachers'!T4,'Subject Teachers'!R4)&"-"&IF(AND('Subject Teachers'!R4<>"",'Subject Teachers'!O4>=70),'Subject Teachers'!O4,'Subject Teachers'!L4)&"-"&IF(AND('Subject Teachers'!L4<>"",'Subject Teachers'!I4>=70),'Subject Teachers'!I4,"N/A")
This simply combines the three results, separated by hyphens. So the result would be something like 80-90-50.

Cognos - Promptmany with default selection 'ALL' not working

I have a report that uses SQL Query. I have a promptmany macro in the SQL:
#promptmany('countryParam', 'string', 'and 1=1' , 'and s.country in (', 'countryParam', ' )')#
This prompt has a default value and 1=1 which should be passed if no value is selected.
On the prompt page, I have the prompt which displays all the countries.
I want the prompt to show All at the top of the list of countries in the prompt box. When the user selects All , no value should be passed in the SQL.
I have tried static choice to use blank and display to use All, but it passes blank value in the sql.
where s.country in ('')
It works with the prompt macro but dosent work with promptmany.
Any suggestions?
Use Static choices. For one option, Display 'All' and use 'All'.
In your filter:
case ?prompt1?
when 'All' then ( 1 = 1 )
else ( [do something here] )
end
After trying a lot of options, I was able to manipulate the SQL. The below SQL works
and ( #prompt('IJParam', 'string', '1=1' , 's.ij_code=')#
or
#promptmany('IJParam', 'string', ' 1=1' , ' s.ij_code in (', 'IJParam', ' )')#
)

Sharepoint date function in conditional formula

I want to add some days when the (type calculated)[No. vacante] column has "vacante 1" or "vacante 2" my code is below. The error I am getting is a syntax error or that the formula is not supported, but i can not figure out where the error is.
=IF([No. vacante]="vacante 1",(DATE(YEAR([fecha ingreso]),MONTH([fecha ingreso]),DAY([fecha ingreso])+1)),
IF([No. vacante]="vacante 2",(DATE(YEAR([fecha ingreso]),MONTH([fecha ingreso]),DAY([fecha ingreso])+2) )),
IF([No. vacante]="vacante 3",(DATE(YEAR([fecha ingreso]),MONTH([fecha ingreso]),DAY([fecha ingreso])+3))))
There are two issues with the provided formula:
The third IF statement is nested at the wrong level (inside of IF #1 instead of IF #2).
The third IF statement also needs a default value as its third parameter, so that the formula always returns some value.
Every IF statement in Sharepoint needs three values: the expression to be evaluated, the value if true, and the value if false. Microsoft provides a more detailed explanation.
I believe the below formula should do the job. Make sure to replace default_value_goes_here with an appropriate default to be used if [No. vacante] does not equal any of vacante 1, vacante 2, or vacante 3.
=
IF(
[No. vacante]="vacante 1",
(DATE
(YEAR([fecha ingreso]),
MONTH([fecha ingreso]),
DAY([fecha ingreso])+1)
),
IF(
[No. vacante]="vacante 2",
(DATE
(YEAR([fecha ingreso]),
MONTH([fecha ingreso]),
DAY([fecha ingreso])+2)
),
IF(
[No. vacante]="vacante 3",
(DATE
(YEAR([fecha ingreso]),
MONTH([fecha ingreso]),
DAY([fecha ingreso])+3)
),
default_value_goes_here
)
)
)

Resources