Excel Formula add data if columns match

[Closed]
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,
I am basic excel user who is slowly needing to use formulas. I have two seperate charts that I've put into 2 worksheets with similar information. Some of the rows will be the same and if they are I need to add the data.
Ex:
sheet1: Sheet2:
A B C D A B C D
1 Bat 2 0 3 1 Toy 3 1 2
2 Car 1 6 0 2 Owl 0 5 3
3 Toy 3 9 4 3 Bat 6 5 0

Soy what I need the formula to do is: If A1 (sheet 2) Matches any cell on column A (Sheet1) then label it 'Toy' and add the following cells for a total B1(s 2) + B3(s1), C1+C3,D1+D3. Final Result: A B C D
1 Toy 6 10 6
Help Please!!

3 replies

Posts
697
Registration date
Thursday May 14, 2009
Status
Member
Last seen
November 24, 2010
218
Well I guess for the first part I should be like this

dim n as interger

for n = 0 to 2
if sheet1.cells(n,0) = Sheet2.cells(0,0) then
Sheet2.Name = "toy"
next
endif

this part take the cells A1 in sheet1 and compare it to the cells in colum a of sheet 2, if the answer is true the sheet is name as toy,

for the rest am sorry but I dont clearly see what you mean
2
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc
AND post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too.


Note:
your data need not be to be real data but a good representative of how data looks like

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!