Dec 03, 2022 09:07 AM - edited Dec 03, 2022 09:08 AM
Hello,
I'm totally new in the formula game, I created mine by putting pieces of tutorials together and using answers obtained here (by the way, thanks to the community!)
That's the deal :
When my cell x show 1h, I need to show 0
When my cell x show 2h, I need to show 0
When my cell x show 3h, I need to show 0
When my cell x show 4h, I need to show 1
When my cell x show 5h, I need to show 2
When my cell x show 6h, I need to show 0
I wrote :
IF(
OR(
{Durée estimée} = "1h",
{Durée estimée} = "2h",
{Durée estimée} = "3h"
{Durée estimée} = "6h"
),
"0"
)
IF(
OR(
{Durée estimée} = "4h",
),
"1"
)
IF(
OR(
{Durée estimée} = "5h",
),
"2"
I do not yet master the closing of the command and I think it comes from there
Do you have an idea please?
Solved! Go to Solution.
Dec 03, 2022 12:21 PM
@alternazYou can write the formula this way:
IF(
OR(
{Text} = "1h",
{Text} = "2h",
{Text} = "3h",
{Text} = "6h"
), "0",
IF({Text} = "4h", "1",
IF({Text} = "5h", "2"
)
)
)
Dec 03, 2022 12:21 PM
@alternazYou can write the formula this way:
IF(
OR(
{Text} = "1h",
{Text} = "2h",
{Text} = "3h",
{Text} = "6h"
), "0",
IF({Text} = "4h", "1",
IF({Text} = "5h", "2"
)
)
)
Dec 03, 2022 06:01 PM
Do you want a number or a text string that looks like a number? If you want an actual number, remove the quotes around the numbers.
You might also consider using a SWITCH() instead of nested IF().
SWITCH( {Durée estimée},
"4h", 1,
"5h", 2,
0
)
Dec 04, 2022 04:42 AM
Hi Andrey, perfect answer, thanks a lot 🙂