Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Need Sum of 2 columns if one is filled?

I need help with a formula. I have two columns - E (projected revenue) and M
(actual revenue). If M has a total in it, I want to ignore the same row in
E, so that the actual revenue is added in to the total sum at the bottom
along with the projected (if there isn't an actual amount) in column M. The
sum is E166. The columns are E2:E165 and M2:M165.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,549
Default Need Sum of 2 columns if one is filled?

=SUMPRODUCT(--(M2:M165<0.001),E2:E165)+SUM(M2:M165)
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"TKGerdie"
wrote in message
I need help with a formula. I have two columns - E (projected revenue) and M
(actual revenue). If M has a total in it, I want to ignore the same row in
E, so that the actual revenue is added in to the total sum at the bottom
along with the projected (if there isn't an actual amount) in column M. The
sum is E166. The columns are E2:E165 and M2:M165.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 127
Default Need Sum of 2 columns if one is filled?

maybe...

=SUMPRODUCT(--(M2:M165="")*(E2:E165))

"TKGerdie" wrote in message
...
I need help with a formula. I have two columns - E (projected revenue) and
M
(actual revenue). If M has a total in it, I want to ignore the same row
in
E, so that the actual revenue is added in to the total sum at the bottom
along with the projected (if there isn't an actual amount) in column M.
The
sum is E166. The columns are E2:E165 and M2:M165.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Need Sum of 2 columns if one is filled?

Thanks Jim - that seems to work. But can you explain the logic on the
formula . . . what is this --( telling the formula to do?

"Jim Cone" wrote:

=SUMPRODUCT(--(M2:M165<0.001),E2:E165)+SUM(M2:M165)
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"TKGerdie"
wrote in message
I need help with a formula. I have two columns - E (projected revenue) and M
(actual revenue). If M has a total in it, I want to ignore the same row in
E, so that the actual revenue is added in to the total sum at the bottom
along with the projected (if there isn't an actual amount) in column M. The
sum is E166. The columns are E2:E165 and M2:M165.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,549
Default Need Sum of 2 columns if one is filled?

You are welcome. As to why the --?

The m2:m165<0.001 part of the formula is not just returning a single value it
actually returns a true/false value for every cell in the range.
The first minus sign then converts each true or false to a number (-1 or 0) then
the second minus sign converts the -1 values to a positive value.
(a zero is always zero).
The formula can then use the converted true/false values to do the calculation.

You can examine a portion of a formula from the formula bar by highlighting
a logical portion of the formula and pressing the F9 key.
Do that with the "m2:m165<0.001" part of the formula and see what you get.
Press the Escape key to exit - don't use the enter key.

Bob Phillips has a very long article on the entire concept at his website...
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

Jim Cone
Portland, Oregon

..

"TKGerdie"
wrote in message
Thanks Jim - that seems to work. But can you explain the logic on the
formula . . . what is this --( telling the formula to do?





"Jim Cone" wrote:
=SUMPRODUCT(--(M2:M165<0.001),E2:E165)+SUM(M2:M165)
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





"TKGerdie"
wrote in message
I need help with a formula. I have two columns - E (projected revenue) and M
(actual revenue). If M has a total in it, I want to ignore the same row in
E, so that the actual revenue is added in to the total sum at the bottom
along with the projected (if there isn't an actual amount) in column M. The
sum is E166. The columns are E2:E165 and M2:M165.

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
Filled cells dont appear as filled SMILLS Excel Discussion (Misc queries) 6 October 18th 07 05:28 PM
Columns with missing data that needs filled in Jannie worksheet function Excel Worksheet Functions 5 August 22nd 07 07:38 PM
Select filled region only in non-adjacent columns hmm Excel Discussion (Misc queries) 1 August 19th 07 03:38 PM
Last filled row Alberto Pinto Excel Discussion (Misc queries) 5 May 18th 06 11:28 AM
show me a filled in timecard example? God is love Setting up and Configuration of Excel 1 December 22nd 04 02:04 AM


All times are GMT +1. The time now is 09:04 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"