Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Data inputted accuracy check

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Data inputted accuracy check

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
analyzing data - accuracy assessment cmlad Excel Discussion (Misc queries) 2 September 29th 09 10:18 PM
Highlighting cells being updated/new data being inputted. Faraz A. Qureshi Excel Discussion (Misc queries) 2 September 8th 09 07:08 AM
Capturing The Date Of When Data Is Inputted justduet Excel Discussion (Misc queries) 1 October 20th 07 07:46 PM
Data Changes itself after I have inputted. Funky Excel Discussion (Misc queries) 5 September 27th 07 01:25 PM
Data Accuracy Nicole Excel Discussion (Misc queries) 0 March 28th 06 04:56 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"