?
Solved

Excel or Access, to automatically fill value based on previous entered data

Posted on 2011-09-20
7
Medium Priority
?
391 Views
Last Modified: 2012-05-12
Hello.
I would like to do the following:
I have a list of values in a column of a table (Column Name: CODES). I must manually enter the correct correspondent code in a second comumn (Column Name: KEN).
After that I would like whenever I add a value in CODES (manually or as an import from another list), to have Excel or Access to automatically fill in the correct correspondent value in KEN column if there is one previously added.

Any answer is welcome.
Regards
 
 
 KEN.xls KEN.xls
0
Comment
Question by:inspironcrk
[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
  • 3
  • 2
  • 2
7 Comments
 
LVL 19

Expert Comment

by:Richard Daneke
ID: 36566222
In Access, your table field Ken can be a combo box with a query that looks for distinct rows of Ken and Codes with the Codes feld as the filter criteria.   This will return any Ken values entered for a specific Code.
See attached db
Database41.accdb
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 36566339
You could set the KEN column to be a lookup of the CODE in the cells above, use a mixture of absolute and relative row references to define the cells above, top row would be absolute, row immediately above would be relative and would therefore move as the formula is copied down.

The user would then only have to input the KEN value for the first occurence of the CODE, overwriting the formula in doing so.

Thanks
Rob H
0
 

Author Comment

by:inspironcrk
ID: 36566659
@ DoDahD: I will try it right now

@robhenson: Can you be more specific? I am very rookie in coding...

Thank you
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:inspironcrk
ID: 36566695
@ DoDahD:

Thanks for the effort. I have the following remarks: Because there will be one to one relationship between the cells, I would like the program to automatically add the correct correspondent value if there is one.

As for the form is not the optimal way to enter the CODES, since I will import them from other tables.

Is it clear?

Regards,
Niktias
0
 
LVL 19

Expert Comment

by:Richard Daneke
ID: 36566758
since I will import them from other tables:   You can use an update query to fill the Ken values if you only have one Ken value for each Code.
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 1000 total points
ID: 36566826
See attached on List2.

I have put formula in column C from row 9 downwards.

You will see that the formula in rows 9 & 11 pull the relevant KEN value from the cells above.

Whereas, the formulaw in rows 10 & 12 give a #N/A error value because they are the first occurence. For the first occurence of a code, type the KEN code in manually and then future occurences in the list will be populated by the formula.

This could be done with a VBA routine instead if so required, checking for input in column B and checking for previous occurences of the code, populating column C accordingly or requesting a code for a new occurence.

Hope this helps.
Rob H KEN.xls
0
 

Author Closing Comment

by:inspironcrk
ID: 36566881
Thank you all. I prefer the excel answer since it is easier for me to handle.
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
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.

752 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