Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Multiple IF conditions then add cells together

How do I do the following:
IF H7,J7,L7=6 is true, then add together G7,I7,K7. I want to add all
figures together that have a 6 in the adjacent column, and ignore others or
add zero.
How do I get this formula to drag across to the next column so that the '6'
changes to '7' but all else remains the same?
Also will the formula work if I have 7 columns of numbers and 7 columns of
figures?
I'm new to these conditional formulas so a specific formula would be
appreciated.
Thanks, Lil

--
Lil
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Multiple IF conditions then add cells together

Try this:

=SUMIF($H6:$L6,COLUMNS($A1:F1),$G6:$K6)

That evaluates to:

=SUMIF($H6:$L6,6,$G6:$K6)

As you drag copy across a row it'll increment to:

=SUMIF($H6:$L6,7,$G6:$K6)
=SUMIF($H6:$L6,8,$G6:$K6)
=SUMIF($H6:$L6,9,$G6:$K6)
etc
etc

--
Biff
Microsoft Excel MVP


"Lil" wrote in message
...
How do I do the following:
IF H7,J7,L7=6 is true, then add together G7,I7,K7. I want to add all
figures together that have a 6 in the adjacent column, and ignore others
or
add zero.
How do I get this formula to drag across to the next column so that the
'6'
changes to '7' but all else remains the same?
Also will the formula work if I have 7 columns of numbers and 7 columns of
figures?
I'm new to these conditional formulas so a specific formula would be
appreciated.
Thanks, Lil

--
Lil



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default Multiple IF conditions then add cells together

How do I do the following:
IF H7,J7,L7=6 is true, then add together G7,I7,K7. I want to add all
figures together that have a 6 in the adjacent column, and ignore
others or add zero.
How do I get this formula to drag across to the next column so that
the '6' changes to '7' but all else remains the same?


One way is to put this in M7 and drag rightward.
=$G7*($H7+7=COLUMN())+
$I7*($J7+7=COLUMN())+
$K7*($L7+7=COLUMN())

It doesn't use an IF; hope that's ok.

The main idea is that the column number where the formula resides
determines the test number: 6, 7, 8, etc. M is column number 13.

Notice that if you put a logical result like ($H7+7=COLUMN()) into an
arithmetic expression, TRUE is treated as 1 (one), FALSE as 0 (zero).


Also will the formula work if I have 7 columns of numbers and 7
columns of figures?


Instead of having a sum of 3 terms, like above, expand it to 7 terms.
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Multiple IF conditions then add cells together

Thanks, both examples work well, I just had to alter it to pick up line 7. I
don't fully understand how it picks up info in alternate columns then adds
other alternate columns, but will try to figure that one out. Thanks for the
help
--
Lil


"T. Valko" wrote:

Try this:

=SUMIF($H6:$L6,COLUMNS($A1:F1),$G6:$K6)

That evaluates to:

=SUMIF($H6:$L6,6,$G6:$K6)

As you drag copy across a row it'll increment to:

=SUMIF($H6:$L6,7,$G6:$K6)
=SUMIF($H6:$L6,8,$G6:$K6)
=SUMIF($H6:$L6,9,$G6:$K6)
etc
etc

--
Biff
Microsoft Excel MVP


"Lil" wrote in message
...
How do I do the following:
IF H7,J7,L7=6 is true, then add together G7,I7,K7. I want to add all
figures together that have a 6 in the adjacent column, and ignore others
or
add zero.
How do I get this formula to drag across to the next column so that the
'6'
changes to '7' but all else remains the same?
Also will the formula work if I have 7 columns of numbers and 7 columns of
figures?
I'm new to these conditional formulas so a specific formula would be
appreciated.
Thanks, Lil

--
Lil




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Multiple IF conditions then add cells together

Thanks for replying, I had trouble getting this to work, but another formula
given to me seems to be working well. Thanks for your reply
--
Lil


"MyVeryOwnSelf" wrote:

How do I do the following:
IF H7,J7,L7=6 is true, then add together G7,I7,K7. I want to add all
figures together that have a 6 in the adjacent column, and ignore
others or add zero.
How do I get this formula to drag across to the next column so that
the '6' changes to '7' but all else remains the same?


One way is to put this in M7 and drag rightward.
=$G7*($H7+7=COLUMN())+
$I7*($J7+7=COLUMN())+
$K7*($L7+7=COLUMN())

It doesn't use an IF; hope that's ok.

The main idea is that the column number where the formula resides
determines the test number: 6, 7, 8, etc. M is column number 13.

Notice that if you put a logical result like ($H7+7=COLUMN()) into an
arithmetic expression, TRUE is treated as 1 (one), FALSE as 0 (zero).


Also will the formula work if I have 7 columns of numbers and 7
columns of figures?


Instead of having a sum of 3 terms, like above, expand it to 7 terms.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Multiple IF conditions then add cells together

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Lil" wrote in message
...
Thanks, both examples work well, I just had to alter it to pick up line 7.
I
don't fully understand how it picks up info in alternate columns then adds
other alternate columns, but will try to figure that one out. Thanks for
the
help
--
Lil


"T. Valko" wrote:

Try this:

=SUMIF($H6:$L6,COLUMNS($A1:F1),$G6:$K6)

That evaluates to:

=SUMIF($H6:$L6,6,$G6:$K6)

As you drag copy across a row it'll increment to:

=SUMIF($H6:$L6,7,$G6:$K6)
=SUMIF($H6:$L6,8,$G6:$K6)
=SUMIF($H6:$L6,9,$G6:$K6)
etc
etc

--
Biff
Microsoft Excel MVP


"Lil" wrote in message
...
How do I do the following:
IF H7,J7,L7=6 is true, then add together G7,I7,K7. I want to add all
figures together that have a 6 in the adjacent column, and ignore
others
or
add zero.
How do I get this formula to drag across to the next column so that the
'6'
changes to '7' but all else remains the same?
Also will the formula work if I have 7 columns of numbers and 7 columns
of
figures?
I'm new to these conditional formulas so a specific formula would be
appreciated.
Thanks, Lil

--
Lil






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting multiple conditions to return a figure from multiple cells Sapper Excel Discussion (Misc queries) 4 April 26th 09 10:33 PM
Search multiple cells with conditions, sum and auto populate! Desperately seeking hammer !! Excel Worksheet Functions 3 August 18th 07 12:20 AM
shade cells based on conditions - i have more than 3 conditions Mo2 Excel Worksheet Functions 3 March 30th 07 07:19 AM
Combining Text from multiple cells under multiple conditions KNS Excel Worksheet Functions 2 June 15th 05 11:00 PM
How to multiple conditions to validate more than 2 conditions to . Bhuvana Govind Excel Worksheet Functions 1 January 28th 05 07:07 PM


All times are GMT +1. The time now is 03:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"