Sharepoint date function in conditional formula - sharepoint

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
)
)
)

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")))

multiple excel OR conditions

Request help:
=IF(AND(OR(
S:S="Sales Hub",
S:S="Office Integration",
S:S="Opportunities",
S:S="Export to Excel",
S:S="Gamification",
S:S="LinkedIn",
S:S="Leads")),
"Project One",
IF(AND(OR(
S:S="Invoices",
S:S="Products and Pricelists",
S:S="Quotes and Orders")),
"Project Two",
IF(AND(OR(
S:S="Quick Campaigns",
S:S="Marketing Lists")),
"Project Three",
""
)
)
)
The above formula returns only Project One for all even though i have matching values to meet Project Two and Three as specified in the nested OR conditions.
Looks like you want to check if any of the specified values is present on column S and if true, then return Project #.
You can do it combining COUNTIF with array criteria and SUM. If it's greater than 0, it means the condition has been met.
=IF(SUM(COUNTIF(S:S;{"Sales Hub";"Office Integration";"Opportunities";"Export to Excel";"Gamification";"LinkedIn";"Leads"}))>0;"Project One";IF(SUM(COUNTIF(S:S;{"Invoices";"Products and Pricelists";"Quotes and Orders"}))>0;"Project Two";IF(SUM(COUNTIF(S:S;{"Quick Campaigns";"Marketing Lists"}))>0;"Project Three";"Error")))

Excel nested IFs stringing together FALSE values and rendering #VALUE

I have the following nested IFs (I know the comments aren't Excel comments, but using them in my text editor helps me through the logic)
// start by seeing if there is an order date
=IF(
$C46<>"",
//there is an order date. have the parts begun to arrive # P2?
IF(
$D46<>"",
//parts have begun to arrive # P2. Have they finished transferring to Brevard?
IF(
$F46<>"",
// product has finished transferring to warehouse. has it begun to ship?
IF(
$G46<>"",
// product has begun to ship. Has it shipped completely?
IF(
$H46<>"",
// has shipped completely. this ends the cycle
IF(
AND(J$5>=$G46,J$5<=$H46),
"S",
"error - shipped completely"
),
// has NOT shipped completely. Here's where to TODAY() formula comes in
IF(
AND(J$5>=$G46,J$5<=TODAY()),
"S",
"error - began shipping, but not complete"
)
)
// product has NOT begun to ship; HAS completely transferred to Brevard. It's in inventory until shipping begins
IF(
AND(J$5>$F46,J$5<=TODAY()),
"I",
"error - finished transferring to Brevard. in Inventory. Not begun to ship"
)
),
// product has begun assembly, but has not finished transferring to Brevard.
IF(
AND(J$5<=$D46,J$5<=TODAY()),
"A",
"error - assembly has begun, has not finished transferring"
)
),
//there is an order date, but parts have not arrived at P2
IF(
AND(J$5<=C46,J$5<=TODAY()),
"O",
"error - order has been taken, assembly has not begun"
)
),
// there is no order date
""
)
When rendering all this, Excel is stringing together the FALSE values and as a result, they are turned into #VALUE, which ruins the entire formula.
What am I doing wrong? If I remove the FALSE values, it still renders #VALUE. I don't understand how to tell it to do exactly nothing, especially multiple times in one algorithm.
You are having too many ELSE in the formula. Thus, after some debugging this is what you get:
at some point. Thus, the #VALUE appears. In general, the nested if syntax in Excel is like this:
Thus, every new =IF is in the ELSE place. Thus, only one ELSE is written (number 5 from the screenshot above)
IF function – nested formulas and avoiding pitfalls
F9 is a good friend in the evaluation of a big formula. Once you select the formula, select a whole internal formula and press F9 to see the result.

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.

IF function for specific text strings

I am trying to write a formula that takes a word and process it through a IF function in excel, The Values are list in the formula. My issue right now is the fact that I have Large, X-Large and 1X-Large text. The X-Large and 1X-Large are unique strings and need the IF function to be able to differentiate the two.
Here is what i have so far.
=if(or(isnumber(search("Small",af2)),ISNUMBER(SEARCH("Medium",AF2)),ISNUMBER(SEARCH("Large",AF2)),,ISNUMBER(SEARCH("X-Large",AF2))),"Small",or(isnumber(search("1X-Large",af2)),isnumber(search("2X-Large",af2)),isnumber(search("3X-Large",af2)),isnumber(search("4X-Large",af2))),"1X-Large")
I cant understand why it's showing an error and only displays small when it works.
All help is appreciated
Your current formula shouldn't work, it should be giving you an error about having too many arguments. A breakdown of your function:
=if(
or(isnumber(search("Small",af2)),ISNUMBER(SEARCH("Medium",AF2)),ISNUMBER(SEARCH("Large",AF2)),,ISNUMBER(SEARCH("X-Large",AF2))),
"Small",
or(isnumber(search("1X-Large",af2)),isnumber(search("2X-Large",af2)),isnumber(search("3X-Large",af2)),isnumber(search("4X-Large",af2))),
"1X-Large"
)
You cannot use 4 parameters in an IF. You need to have a maximum of 3. Maybe what you meant was:
=if(
or(isnumber(search("Small",af2)),ISNUMBER(SEARCH("Medium",AF2)),ISNUMBER(SEARCH("Large",AF2)),,ISNUMBER(SEARCH("X-Large",AF2))),
"Small",
IF(
or(isnumber(search("1X-Large",af2)),isnumber(search("2X-Large",af2)),isnumber(search("3X-Large",af2)),isnumber(search("4X-Large",af2))),
"1X-Large"
)
)
But that doesn't solve your issue about the X-Large part. To cater for that, you can check whether the X-Large series exist first, then the others.
=IF(
OR(ISNUMBER(SEARCH("1X-Large",AF2)),ISNUMBER(SEARCH("2X-Large",AF2)),ISNUMBER(SEARCH("3X-Large",AF2)),ISNUMBER(SEARCH("4X-Large",AF2))),
"1X-Large",
IF(
OR(ISNUMBER(SEARCH("Small",AF2)),ISNUMBER(SEARCH("Medium",AF2)),ISNUMBER(SEARCH("Large",AF2)),ISNUMBER(SEARCH("X-Large",AF2))),
"Small"
)
)
Although you can make it shorter with this:
=IF(
OR(ISNUMBER(SEARCH({"1X-Large","2X-Large","3X-Large","4X-Large"},AF2))),
"1X-Large",
IF(
OR(ISNUMBER(SEARCH({"Small","Medium","Large","X-Large"},AF2))),
"Small"
)
)
In one line...
=IF(OR(ISNUMBER(SEARCH({"1X-Large","2X-Large","3X-Large","4X-Large"},AF2))),"1X-Large",IF(OR(ISNUMBER(SEARCH({"Small","Medium","Large","X-Large"},AF2))),"Small"))

Resources