CaptainGravyBum
Board Regular
- Joined
- Dec 1, 2023
- Messages
- 77
- Office Version
- 365
- Platform
- Windows
OK, I've tried my best, but I just can't find out what is going on with this formula. Chat GPT is usually a little helpful, but even that is stumped - you can't beat good old fashioned brain power so I'm hoping you can help.
The link to my file is below, I'm trying to add a formula in column R of the upload template sheet which looks for various criteria to be met before providing a result - mainly because there is a lot of error checking due to the data being provided by various people who can make errors. I can get cell R2 to return 8:00 which is correct, but then everything else is false, as though it looks at the first IF and ignores all others. At the moment it's ignoring the cells which don't return a time which is what I want, but also returning false for the cells where there should be data.
=IFERROR(
IF('Vigo Data'!AF1=0,IF(AND((SEARCH("AM",Q2)), 'Vigo Data'!AF1 >= TIME(5, 0, 0), 'Vigo Data'!AF1 <= TIME(11, 59, 0)), 'Vigo Data'!AF1,"")&
IF('Vigo Data'!AF1=0,IF(AND((SEARCH("PM", Q2)), 'Vigo Data'!AF1 >= TIME(12, 1, 0), 'Vigo Data'!AF1 <= TIME(23, 59, 0)), 'Vigo Data'!AF1,"")&
IF('Vigo Data'!AF1=0,IF(AND((SEARCH("TIME", Q2)), 'Vigo Data'!AF1 >= TIME(0, 1, 0), 'Vigo Data'!AF1 <= TIME(23, 59, 0)), 'Vigo Data'!AF1,"")))),"")
The link to my file is below, I'm trying to add a formula in column R of the upload template sheet which looks for various criteria to be met before providing a result - mainly because there is a lot of error checking due to the data being provided by various people who can make errors. I can get cell R2 to return 8:00 which is correct, but then everything else is false, as though it looks at the first IF and ignores all others. At the moment it's ignoring the cells which don't return a time which is what I want, but also returning false for the cells where there should be data.
=IFERROR(
IF('Vigo Data'!AF1=0,IF(AND((SEARCH("AM",Q2)), 'Vigo Data'!AF1 >= TIME(5, 0, 0), 'Vigo Data'!AF1 <= TIME(11, 59, 0)), 'Vigo Data'!AF1,"")&
IF('Vigo Data'!AF1=0,IF(AND((SEARCH("PM", Q2)), 'Vigo Data'!AF1 >= TIME(12, 1, 0), 'Vigo Data'!AF1 <= TIME(23, 59, 0)), 'Vigo Data'!AF1,"")&
IF('Vigo Data'!AF1=0,IF(AND((SEARCH("TIME", Q2)), 'Vigo Data'!AF1 >= TIME(0, 1, 0), 'Vigo Data'!AF1 <= TIME(23, 59, 0)), 'Vigo Data'!AF1,"")))),"")