# IF + INT/INDEX

Options

Hello! I'm having trouble getting this formula to work (it's giving invalid data type):

=IF(AND({OTD/FTY Range 4}) = YEAR(TODAY()); IF(AND({OTD/FTY Range 1} = "1"; IF({OTD/FTY Range 2} = "90%"; INT({OTD/FTY Range 3})))))

So what I want to do is create multiple if statements. The first is if the year column is the year today; the second is if the month column (it's not a date column) equals the number "x" ("1" being january, etc.); and the third is if the cell value equals to 90%. If all of those statements are true, then I want to index the cell value.

• ✭✭✭✭✭✭
Options

=IFERROR(INDEX(COLLECT({Range To Pull}, {Year Range}, @cell = YEAR(TODAY(), {Month Range}, @cell = 1, {% Range}, @cell = 0.90), 1), "")

• Options

@Paul Newcome It´s giving incorrect argument :/

Here's a picture from the sheet I'm trying to extract this info from! The "Meta" column is actually a formula column. I tried to alter you formula to "90%" but it still isn't working

• ✭✭✭✭✭✭
Options

Each {Range} should only be referencing a single column. Do you have that error anywhere in any of the cells being referenced in your ranges?

• edited 03/31/23
Options

@Paul Newcome I think the problem is at the year(today()) formula... I removed it and it's working perfectly, but I still want to add that statement. Here's the formula now:

=IFERROR(INDEX(COLLECT({OTD/FTY Range 3}; {OTD/FTY Intervalo 1}; @cell = 1; {OTD/FTY Range 2}; @cell = "90%"); 1); "")

I tried to add {OTD/FTY Range 4}; @cell = YEAR(TODAY()) and it didn't work

• ✭✭✭✭✭✭
Options

How is the Year column being populated?

• Options

@Paul Newcome By hand! I just digit "2023" on the cell

• ✭✭✭✭✭✭
Options

It looks like I missed a closing parenthesis in my first formula. Here it is corrected.:

=IFERROR(INDEX(COLLECT({Range To Pull}, {Year Range}, @cell = YEAR(TODAY()), {Month Range}, @cell = 1, {% Range}, @cell = 0.90), 1), "")

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!