COUNTIFS with vLookup Results
When i reference the VLOOKUP fields in the COUNTIFS formula, I get this error #NO MATCH.
=COUNTIFS([Server Install Status]:[Server Install Status], "Installed", [In Scope]:[In Scope], "Yes")
The [Server Install Status] column is populated with the results of =VLOOKUP([Server Name]1, {cmdb_ci_win_server20200810 Range 1}, 3, false). The results in the column are correct. However, when I reference this data in the COUNTIFS formula, I get the error above.
Please advise.
Best Answers
-
If any value in your [Server Install Status] column has "#No Match", you will get an error in your formula that is looking in that column.
The formula is ok, it's the data that's causing your problem. Go back to your data, find the row that has "#No Match" and see if you can resolve the lookup error.
-
Hi Lisa,
#NO MATCH in a COUNTIFS happens when you have a #NO MATCH on your VLOOKUP. And you only need one occurence of a #NO MATCH in the VLOOKUP for the COUNTIFS to return it. Otherwise, the COUNTIFS formula would return 0. So the problem comes from the VLOOKUP.
Could you provide us some screenshots of the VLOOKUP with no sensitive datas on it for us to help?
-
Hi @Lisa Blair
Instead of using the IFERROR on the COUNTIFS function, use it on the VLOOKUP formula. Hence, instead of a #NO MATCH, you'll get a blank cell.
COUNTIF will deal better with BLANK cells than error cells I believe.
=IFERROR(VLOOKUP([Server Name]1, {cmdb_ci_win_server20200810 Range 1}, 3, false),"")
=COUNTIFS([Server Install Status]:[Server Install Status], "Installed", [In Scope]:[In Scope], "Yes")
Answers
-
If any value in your [Server Install Status] column has "#No Match", you will get an error in your formula that is looking in that column.
The formula is ok, it's the data that's causing your problem. Go back to your data, find the row that has "#No Match" and see if you can resolve the lookup error.
-
Hi Lisa,
#NO MATCH in a COUNTIFS happens when you have a #NO MATCH on your VLOOKUP. And you only need one occurence of a #NO MATCH in the VLOOKUP for the COUNTIFS to return it. Otherwise, the COUNTIFS formula would return 0. So the problem comes from the VLOOKUP.
Could you provide us some screenshots of the VLOOKUP with no sensitive datas on it for us to help?
-
There are a few rows with #NO MATCH. Is there a way to resolve this in the formula?
-
I tried to use the IFERROR formula with it, but it doesn't render the count I expect. It just returned a blank, not the total number of rows with data.
=IFERROR(COUNTIFS([Server Install Status]:[Server Install Status], "Installed", [In Scope]:[In Scope], "Yes"), " ")
More background in case it helps with suggestions... My project tracking sheet has rows of data with server names, if the server is in scope and what the install status is of the server (i.e. Installed, Retired, etc.). Instead of looking up each server status in the CMDB individually, I
- Create a report from the CMDB with the server names and their respective install statuses,
- Import the CMDB report into Smartsheet,
- Use the vLookup formula to update the install status on my primary tracking sheet
It is very likely that a couple of the servers on the CMDB <> have a match in the primary tracking sheet, thus the #NO MATCH result.
Since, I am working with server names, and can not share that information here.
-
Hi @Lisa Blair
Instead of using the IFERROR on the COUNTIFS function, use it on the VLOOKUP formula. Hence, instead of a #NO MATCH, you'll get a blank cell.
COUNTIF will deal better with BLANK cells than error cells I believe.
=IFERROR(VLOOKUP([Server Name]1, {cmdb_ci_win_server20200810 Range 1}, 3, false),"")
=COUNTIFS([Server Install Status]:[Server Install Status], "Installed", [In Scope]:[In Scope], "Yes")
-
Thanks @David Joyeuse , @MCorbin,
I was able to use
=IFERROR(VLOOKUP([Server Name]4060, {NEW SPREADSHEET Range 1}, 3, false), (VLOOKUP([Server Name]4060, {ORIGINAL SPREADSHEET Range 1}, 4, false))) to prevent the #NO MATCH error. Then, I was able to use
=COUNT(DISTINCT(COLLECT([Server Name]:[Server Name], [In Scope]:[In Scope], @cell <> "No", [Server Install Status]:[Server Install Status], @cell = "Installed")))
… to obtain my goal of the count of DISTINCT, IN SCOPE, INSTALLED server names.
I appreciate all of your help! 😎
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!