Phil Smith
Active Member
- Joined
- Aug 13, 2004
- Messages
- 285
- Office Version
- 365
- Platform
- Mobile
After much headbanging and lots of reworded web searches, I have come up with the following formula,
=IF(MATCH("End",A:A)=16,"COVER",IF(SUMPRODUCT(--(B13:B100=Stations))>0,"RUNNING","DEPOT"))
only for it to produce an #N/A error.
I got the SUMPRODUCT part of formula from [url]https://exceljet.net/formula/range-contains-one-of-many-values
[/URL]
The first part, IF(MATCH("End",A:A)=16 works absolutely fine.
The last part, IF(SUMPRODUCT(--(B13:B100=Stations))>0,"RUNNING","DEPOT")) , is where it throws up the #N/A error
I couldn't work out how to reference a dynamic range for column B using MATCH("End",A:A) to find the final row. Therefore I have used a static range of B13:B100 will capture more than enough data to make a comparison to my named range, "Stations".
If there is ANY match at all between the data in B13:B100 and the named range "Stations", then the cell should show "RUNNING", otherwise "DEPOT".
Can anyone enlighten me to what is causing the error and how to rectify it?
=IF(MATCH("End",A:A)=16,"COVER",IF(SUMPRODUCT(--(B13:B100=Stations))>0,"RUNNING","DEPOT"))
only for it to produce an #N/A error.
I got the SUMPRODUCT part of formula from [url]https://exceljet.net/formula/range-contains-one-of-many-values
[/URL]
The first part, IF(MATCH("End",A:A)=16 works absolutely fine.
The last part, IF(SUMPRODUCT(--(B13:B100=Stations))>0,"RUNNING","DEPOT")) , is where it throws up the #N/A error
I couldn't work out how to reference a dynamic range for column B using MATCH("End",A:A) to find the final row. Therefore I have used a static range of B13:B100 will capture more than enough data to make a comparison to my named range, "Stations".
If there is ANY match at all between the data in B13:B100 and the named range "Stations", then the cell should show "RUNNING", otherwise "DEPOT".
Can anyone enlighten me to what is causing the error and how to rectify it?