An easy fix is to use a simple conditional:
=IF(COUNTIF(range, item)=0,"Item is not in the range", - Your old formula here - )
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am looking to create a formula that will return a value in the same row as the last time an item name is listed in a table. The following formula works accurately when there is a match; however it returns 2 for an item that does not appear in the table.
{=INDEX(CountLogTbl,MAX(IF(CountLogTbl[Item]=[@Item],ROW(Items)-MIN(ROW(CountLogTbl[Item]))+1)),4)}
For more clarity, the CountLogTbl contains unit counts of an item in stock, I am trying to find the last time a count was entered for that item in the CountLogTbl. Again, this works when the item name is matched, but if the item is not found it is returning 2.
Can anyone see why it would return 2? Without the index portion, the max formula returns 0 which would be accurate.
Thanks in advance!
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
An easy fix is to use a simple conditional:
=IF(COUNTIF(range, item)=0,"Item is not in the range", - Your old formula here - )
Good idea, thank you!
Hi there
You may try the following formula solution
=LOOKUP(2,1/(CountLogTbl[Item]=E2),CountLogTbl[Count])
The following links will provide you with further explanations and ideas.
https://exceljet.net/formula/lookup-latest-price
https://exceljet.net/formula/get-value-of-last-non-empty-cell
I hope this helps you and gives a solution to your problem
Do let me know if you need more help
Regards
Jeovany