Solved

Excel Formula to find what is missing

Posted on 2013-02-01
9
178 Views
Last Modified: 2013-02-06
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
Comment
Question by:newparadigmz
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 10

Expert Comment

by:Anthony Berenguel
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

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

Author Comment

by:newparadigmz
ID: 38844686
i am looking for something that will tell me what form/state combination does not exist
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Expert Comment

by:Nalinkumarbalaji
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

by:leptonka
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

by:newparadigmz
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

by:newparadigmz
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

by:
leptonka earned 500 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

by:newparadigmz
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question