Smarter Idea

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,
I have to check if there is data in B1:B3 (for example the entry '12') if
so, I need to add/sum the number that is written in the parallel cell in
A1:A3.
For example if in B1 = o,B2=12,B3=12 and in A1=1,A2=2,A3=3. then the total
(represent in cell C1) will be 5. I accomplished that by using IF sentence
for each entry. Is there a more smart way to do this?
Thanks a lot in advance
 
=SUMIF(B1:B3,12,A1:A3)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Try this in C1:

=SUMIF(B1:B3,12,A1:A3)

You can adjust the cell references for longer ranges, eg:

=SUMIF(B1:B15,12,A1:A15)

which you would not be able to do in your IF statements.

Hope this helps.

Pete
 
Look in HELP for the SUMIF() function

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Hi All,
| I have to check if there is data in B1:B3 (for example the entry '12') if
| so, I need to add/sum the number that is written in the parallel cell in
| A1:A3.
| For example if in B1 = o,B2=12,B3=12 and in A1=1,A2=2,A3=3. then the total
| (represent in cell C1) will be 5. I accomplished that by using IF sentence
| for each entry. Is there a more smart way to do this?
| Thanks a lot in advance
|
 
it worked up gr8....
I can't believe i missed it...
Thanks a lot y'all...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top