Solved

Excel Formula to find what is missing

Posted on 2013-02-01
9
172 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

910 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now