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.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Welcome to MrExcel -- try
Book2
ABCDEFGH
1NameNumberNameNumberNameNumberNameNumber
2alex34foo56alex1foo100
3foo3alex13foo2foo80
4alex9alex45foo3alex60
5foo7foo99alex4foo40
6
7alex166
Sheet2
 
Upvote 0
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?
 
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,874
Messages
6,122,034
Members
449,061
Latest member
TheRealJoaquin

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