Len if and

horizonflame

Board Regular
Hi

I have set-up the below but the LEN calculation seems wrong as LEN that isn't 15 is matching and doing the workday function.

=IF(AND(LEN(\$B10=15),\$C10="Apple"),WORKDAY(\$I10,45,Info!\$B\$18:\$B\$25),
IF(AND(LEN(\$B10=15),\$C10="Banana"),WORKDAY(\$I10,45,Info!\$B\$18:\$B\$25),\$I10))
Can anyone see what is wrong please?

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Fluff

MrExcel MVP, Moderator
You've got the clsoing bracket in the wrong place, it should be
LEN(\$B10)=15,\$C10

horizonflame

Board Regular
Thanks Fluff! I'm now getting #VALUE error on the values that match - any idea on what's wrong there?

Thanks

Fluff

MrExcel MVP, Moderator
Can you post some sample data?

horizonflame

Board Regular
 COLUMN B COLUMN D COLUMN I FORMULA COLUMN 777/11215 Pear 30/03/2020 30/03/2020 777/11531 Apple 30/09/2019 30/09/2019 777/00164 Melon 31/07/2019 31/07/2019 777/11392 Banana 29/08/2019 29/08/2019 777/11875 Banana 30/09/2019 30/09/2019 777/11389 Apple 31/07/2019 31/07/2019 777/11390 Pear 29/11/2019 29/11/2019 777/11680/04/01 Apple 31/03/2020 #VALUE

<tbody>
</tbody>

Last edited:

Fluff

MrExcel MVP, Moderator
One thing that springs to mind is the formula is looking at col C, but your sample shows it should be col D.
Also the word Apple on row 10 has a space after it.
Another thing to check is make sure the dates on the info sheet are real dates, rather than text.

horizonflame

Board Regular
One thing that springs to mind is the formula is looking at col C, but your sample shows it should be col D.
Also the word Apple on row 10 has a space after it.
Another thing to check is make sure the dates on the info sheet are real dates, rather than text.
Thanks Fluff - the issue was the dates ref. Cheers!

Fluff

MrExcel MVP, Moderator
You're welcome & thanks for the feedback