Help with "If" Formula/statement

maza_minx

New Member
Joined
Oct 17, 2005
Messages
24
Hi All,

Hope you can help me out with this one. I have a sheet which contains rows of data. Each column has a name and the column right next to it contains a number. This pattern continues for about 8 columns.

E.g.
Name, #, Name, #, Name, #, Name, #

I need to build a formula that will say If Name = " ", then count # in the next column.

E.g.
Alex, 8 - So the formula will know that if the "name" column contains the text "Alex" it will then count the number 8 which is posted in the next column.

Please keep in mind that I will need this formula to eventually sum up all numbers where Alex (or different names) appears. Any help or guidance you can provide would be greatly appreciated.

Thanks.
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

just_jon

Legend
Joined
Sep 3, 2002
Messages
10,473
Welcome to MrExcel -- try
Book2
ABCDEFGH
1NameNumberNameNumberNameNumberNameNumber
2alex34foo56alex1foo100
3foo3alex13foo2foo80
4alex9alex45foo3alex60
5foo7foo99alex4foo40
6
7alex166
Sheet2
 

Gates Is Antichrist

Well-known Member
Joined
Aug 15, 2002
Messages
1,961
A less concise approach (but which provides more detail :p ) uses sumif:

Underneath column A, type (or preferably paste) Alex and the other names. Let's say that the first is in A20. Then
B20=SUMIF(A20,A$1:A$19)
and copy down, so that e.g.
B21=SUMIF(A21,A$1:A$19)

You can do the same process for columns C/D, etc. and combine as desired. Clear?
 

maza_minx

New Member
Joined
Oct 17, 2005
Messages
24
Hi Jon,

Thanks for that detailed reply. I tried to copy the formula directly into my sheet and change the coordinates accordingly but it does not seem to be picking up the numbers. Value is coming out as ZERO...any suggestions?
 

just_jon

Legend
Joined
Sep 3, 2002
Messages
10,473

ADVERTISEMENT

Which formula?
 

Gates Is Antichrist

Well-known Member
Joined
Aug 15, 2002
Messages
1,961
Highlight the formula's cell (left-click it), then hit F2 to see if it's operating on the desired target range. The range to be "sumproducted" should be outlined in blue then. (Hit escape key when done)

I suspect that you need $ anchors, for everything except the A7 in jon's fine example. The above technique will expose this.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,812
Messages
5,574,455
Members
412,595
Latest member
slim313
Top