Excel Formula add data if columns match

Closed
kv - Sep 4, 2009 at 01:44 PM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Aug 20, 2010 at 09:37 AM
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

sadgurl Posts 697 Registration date Thursday May 14, 2009 Status Member Last seen November 24, 2010 219
Sep 4, 2009 at 02:32 PM
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
use =if(
-1
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Aug 20, 2010 at 09:37 AM
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
-2