Macro for updating a cell on a value match

elitekatti

New Member
Joined
Feb 10, 2011
Messages
9
Hi,

I have used excel for real basic stuffs hence very new to macros and such stuffs..
I ll describe my requirement in brief:

I have a 'name' field (person entry) and 'count' field (score) in the below format in Worksheet1:
Name Count
----- ------
abc 5
def 10
xyz 10

In Worksheet2, I have an 'output' field under which I enter the result - say as "true" or "false".

Output True
-----

Now in Worksheet3, I have the entries voted by each person as shown below (Note: the entires need not be in same order as in Worksheet1):

Name answer
------ -------
abc false
xyz true
def true

Now here, I need a MACRO for a Button_click (even a formula would do) which checks the correct result in worksheet2 (True/ false) and validate worksheet3 to see how many people have answered correctly and finally in worksheet1 increment the count for respective names who answered correctly.

Explaining in the above example:
The output is "true" and hence macro shall validate worksheet3 and find out that "xyz" and "def" have answered correctly. So update the count value by say 5 for "xyz" and "def" in worksheet1.
Hence Worksheet 1 shall now show:

Names Count
------ ------
abc 5
def 15
xyz 15

I would really appreciate answers to this question in the coming two days as I am constrained by time to get this thing working! :(

Thanks in advance! ;)
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi,

I have used excel for real basic stuffs hence very new to macros and such stuffs..
I ll describe my requirement in brief:

I have a 'name' field (person entry) and 'count' field (score) in the below format in Worksheet1:
Name Count
----- ------
abc 5
def 10
xyz 10

In Worksheet2, I have an 'output' field under which I enter the result - say as "true" or "false".

Output True
-----

Now in Worksheet3, I have the entries voted by each person as shown below (Note: the entires need not be in same order as in Worksheet1):

Name answer
------ -------
abc false
xyz true
def true

Now here, I need a MACRO for a Button_click (even a formula would do) which checks the correct result in worksheet2 (True/ false) and validate worksheet3 to see how many people have answered correctly and finally in worksheet1 increment the count for respective names who answered correctly.

Explaining in the above example:
The output is "true" and hence macro shall validate worksheet3 and find out that "xyz" and "def" have answered correctly. So update the count value by say 5 for "xyz" and "def" in worksheet1.
Hence Worksheet 1 shall now show:

Names Count
------ ------
abc 5
def 15
xyz 15

I would really appreciate answers to this question in the coming two days as I am constrained by time to get this thing working! :(

Thanks in advance! ;)
I hope my question is easy-to-understand. Please let me know if there is any confusion in the question.
I am awaiting for solution to this one. early-the-better!
Thanks!
 
Upvote 0
I have been trying to find a solution to this... facing some problems.. Looking forward for help atleast here!
I tried using IF function.
IF:-
logical condn : Worksheet3!b2:b4 = worksheet2!b2
value_if_true : Here i want check the cells (in column A) in worksheet 3 that PASS the above logical condition (i.e., whose corresponding B column values are True) AND for those selected names, in Worksheet 1 - add +5 to the corresponding next cell. This can be better understood by referring the example in the original question.
value_if_false : all other cells whose values does not satisfy the above logical condition, their corresponding names (value in corresponding A column) in worksheet 1 will have the corresponding next cell value subtracted by 5 or 0.
 
Upvote 0
Disappointing to see no responses! :(
Is it that what I am asking is not possible in excel or is it too simple to ask such a question???
I was hoping atleast some way forward with regard to this problem!
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top