IF Then

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

Guest

I'm trying to create a formula that would look in a column of another tab for
one of two last names and if it equaled a name then it would look in another
column for a dollar amount and add it to the cell. For example; If Tab 1
column A equals Champ then add column C and if Tab 2 column A equals Champ
then add column D. Thanks for your help in advance.
 
Rick,

I'm afraid your question is a bit lacking on clarity in that you don't say
what you want if neither cell contains champ or if both do. So as a guess try
this:-

=IF(AND(A1="Champ",Sheet2!A1="Champ"),C1&D1,IF(A1="Champ",C1,IF(Sheet2!A1="Champ",D1,"You didn't say")))

Mike
 
It sounds like you could use =vlookup() or =index(match()).

Debra Dalgleish has lots of notes on =vlookup() and =index(match()) here:
http://www.contextures.com/xlFunctions02.html (for =vlookup())
and
http://www.contextures.com/xlFunctions03.html (for =index(match()))

I would bring back the value in a separate column, then use that returned value
in a formula in another column:

A2 contains Champ
B2 contains whatever
C2 contains a number of something
D2 contains a formula to bring a value back:
=if(isna(vlookup(a2,sheet2!a:c,3,false)),0,vlookup(a2,sheet2!a:c,3,false))
E2 contains a formula that returns the sum of column C and D.
=sum(c2:d2)
 
Ps. If you're using xl2007, you could use =iferror() instead of using
=vlookup() twice in that formula.
 
if I am reading what you want correctly and Tab 1 and Tab 2 are different
sheets

=sumif('Tab 1"!A:A,"Name 1",'Tab 1'!C:C)+sumif('Tab 2"!A:A,"Name 1",'Tab
2'!D:D)+sumif('Tab 1"!A:A,"Name 2",'Tab 1'!C:C)+sumif('Tab 2"!A:A,"Name
2",'Tab 2'!D:D)

if you want the C and D columns form the same shet as the equation is in then

=sumif('Tab 1"!A:A,"Name 1",C:C)+sumif('Tab 2"!A:A,"Name 1",D:D)+sumif('Tab
1"!A:A,"Name 2",C:C)+sumif('Tab 2"!A:A,"Name 2",!D:D)
 

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