How do I make excel add in one column if conditions are met in ano

J

Jodie

For example, I want to say, if anything in column A (from rows 1-20) =1, then
add whatever is in column B for that same row and put it in field G26. Then
I want to say, if anything in column A (from rows 1-20) = 2, then add
whatever is in column B for that same row and it it in field H26, and so on
through, if anything in column A (from rows 1-20) =8, then add whatever is in
column B for that same row and put it in field M26. Does anyone know how I
can do that??
 
T

T. Valko

G26:M26 = 7 cells

Try this entered in G26 and copied across as needed:

=SUMIF($A1:$A20,COLUMNS($G26:G26),$B1:$B20)
 
J

Jodie

Wow. I'm stunned. It works great! You're right, I meant F26:M26. Thank
you SOOOO much!
--
Jodie


T. Valko said:
G26:M26 = 7 cells

Try this entered in G26 and copied across as needed:

=SUMIF($A1:$A20,COLUMNS($G26:G26),$B1:$B20)
 
T

T. Valko

I meant F26:M26.

Just change the reference from $G26:G26 to $F26:F26.

=SUMIF($A1:$A20,COLUMNS($F26:F26),$B1:$B20)


--
Biff
Microsoft Excel MVP


Jodie said:
Wow. I'm stunned. It works great! You're right, I meant F26:M26. Thank
you SOOOO much!
 

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

Top