Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Excel Formula to find what is missing

Posted on 2013-02-01
Medium Priority
189 Views
I have a list in one column, of form names.
Each form should have a correspond state code in the column next to it.

Every form should be listed 50 times, each with only one state next to it.

Is there a non-VBA formula that checks for that and tells me what is missing, either form or state?

It can be 2 different formulas, one checking for missing forms, and one for missing states

example attached
Book3.xlsx
0
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 4
• 2
• 2
• +1

LVL 10

Expert Comment

ID: 38844415
You can count each state using countif(), or you can lookup each state to make sure its in your list with vLookup().
0

LVL 3

Expert Comment

ID: 38844434
Please check the attached file having the formula updated
Book3.xlsx
0

Author Comment

ID: 38844686
i am looking for something that will tell me what form/state combination does not exist
0

LVL 3

Expert Comment

ID: 38844803
In the Excel sheet what i have attached will display the value with N/A for Forms and States which is not Exists in the Whole List.

sample Forms: =VLOOKUP(A2:A10,H:H,1,0)
Sample States: =VLOOKUP(D2:D10,I:I,1,0)

If you want the excel to automatically listed into the Another Sheet. Then for that you have to do VBA code, or some front end application (Vb.net) to achieve this.
0

LVL 7

Expert Comment

ID: 38845817
Hi,

If I understand well, you would like to check the form-state combinations?
I created a file with a possible solution using formulas.
In column F and G you find array formulas, so make sure both is confirmed with Ctrl+Shift+Enter into a large range of cells.
In column H there is a check formula showing "missing" for the combination does not exists under the Actuals list.

Cheers,
Kris
Find-missing-solution.xlsx
0

Author Comment

ID: 38851421
Yes!

But can you please explain if you can, because I can never implement something I don't understand.

I get that you are multiplying the number of forms (9) by the number of rows (6) to get 54.
Then you are creating the range 1:54.
The -1's and +1's are to account for the headers.
And Index is to pluck the value.

But, what is the mechanism/logic that cycles through the sets to get each form 6 times and each state 9 times? I guess that's the Int and Mod parts, but I still can't wrap my head around it.
0

Author Comment

ID: 38851916
Also, is there a limitation to this formula?

It works for me up until I hit 700 + rows.

My actual data has 317 forms, 52 states.
0

LVL 7

Accepted Solution

leptonka earned 2000 total points
ID: 38852741
Hi,
So explanation first:
To create all the possible combinations, I choose the first value form Forms and combine with all the values from States. So I need to repeat this first Form as many times as the number of elements of States. Then I get need the next form.
I use INDEX function so I need the index numbers. Following the above logic, I need to repeat number 1 as many times as the elements of States. Then I repeat number 2, 3... To have this index-vector: 1.1.1.1.1.1.2.2.2.2.2.2.3.3.3.3.3.3 .... I use the INT function. I take the series: 0.1.2.3.4.5.6.7..... which is the result of ROW function, I divide it by the number of elements in States :ROWS(States) and calculate the integer part with INT.
Similarly for States: I have to go through all the elements of states for each element of Forms, so I need this index vector: 1.2.3.4.5.6.1.2.3.4.5.6.1.2.3.4.5.6 because in the example there are 6 elements in states. This will be the result of the MOD function.

If you have many rows in forms and states, better to use a copy-down formula. I created another solution, based on exactly the same logic, but using normal row numbers. In this case it is important that the header row is one row above the first row - it makes possible to have a series of numbers starting from 1.
You should copy these formulas down to 317*52=16484 rows.

I hope it helps and you understand my explanation.

Cheers,
Kris
Find-missing-solution.xlsx
0

Author Closing Comment

ID: 38860858
Amazing!

I still don't fully follow the math part, but now I understand that it is the row number of the cell that the formula resides in that drives the "changing" of values.

Can you recommend a resource to learn about these kinds of techniques?

Thanks so much
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, tâ€¦
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
###### Suggested Courses
Course of the Month7 days, 10 hours left to enroll