PC Review


Reply
Thread Tools Rate Thread

Data inputted accuracy check

 
 
MJKelly
Guest
Posts: n/a
 
      20th Aug 2007
How do I run through a few worksheets of data to check that certain
values are correct, according to another criteria?

i.e. if A1 = "Fruit", the value of B1 is either Apple or Pair or
Banana. Or, if A1 = "Vegetable", the value of B1 must be either
Carrot or Potato.
Then proceed to A2 and check the value of B2 and so on.

If an error is found, I would like the cell backgroud colour changed
to Yellow and an error count increased by 1.

I have quite a few categories and values which can be attributed to
them (loads more Fruit and Veg types as well as other food types and
their products), so would I need to contain all of the correct options
in the macro or could it reference and check against a table on a
worksheet?

kind regards,
Matt

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Z2xlbnRvbg==?=
Guest
Posts: n/a
 
      20th Aug 2007
Hi

The question as you ask it is relatively easily done. My question first
though, is why not just use a vlookup?

You'd create a second table with all the food stuffs (banana, etc) in the
1st col, and the categories (fruit etc) in the second. This is probably a
much shorter table then the large one you're wanting to check.

Then create a third column in the large table with the vlookup formula. If
you wanted to you could have conditional formating to create the colour
effect you're after.

Suppose the short table is in columns A:B of sheet2, and the big database
you're wanting to check is in A2:B1000.
Then in C2 put this formula: "=VLOOKUP(B2,sheet2!A:B,2,false)"
C2 will then contain the category your food stuff is meant to have.
You could then put a formula in D2 to check whether C2 is the same as A2, or
you could roll this into one by changing the formula in C2
to:"=VLOOKUP(B2,sheet2!A:B,2,false)=A2".

Then conditional formating on C2 with yellow if it's FALSE.

I hope this helps


-- ----
Glenton
www.leviqqio.com
Quality financial modelling


"MJKelly" wrote:

> How do I run through a few worksheets of data to check that certain
> values are correct, according to another criteria?
>
> i.e. if A1 = "Fruit", the value of B1 is either Apple or Pair or
> Banana. Or, if A1 = "Vegetable", the value of B1 must be either
> Carrot or Potato.
> Then proceed to A2 and check the value of B2 and so on.
>
> If an error is found, I would like the cell backgroud colour changed
> to Yellow and an error count increased by 1.
>
> I have quite a few categories and values which can be attributed to
> them (loads more Fruit and Veg types as well as other food types and
> their products), so would I need to contain all of the correct options
> in the macro or could it reference and check against a table on a
> worksheet?
>
> kind regards,
> Matt
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you spell check the inputted parts of a protected form? pstubbs6675 Microsoft Word Document Management 1 14th Aug 2009 03:40 PM
All possible combinations of data inputted under three headings Randy Microsoft Excel Programming 1 3rd Jun 2009 11:21 AM
Capturing The Date Of When Data Is Inputted =?Utf-8?B?anVzdGR1ZXQ=?= Microsoft Excel Misc 1 20th Oct 2007 07:46 PM
Data Changes itself after I have inputted. =?Utf-8?B?RnVua3k=?= Microsoft Excel Misc 5 27th Sep 2007 01:25 PM
Is it possible to use spell check to check accuracy of phone numbe =?Utf-8?B?UmFobg==?= Microsoft Word Document Management 1 26th Apr 2005 04:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:32 AM.