Solved

Excel Formula to find what is missing

Posted on 2013-02-01
9
185 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
[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
  • Learn & ask questions
  • 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

623 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