#1
|
|||
|
|||
Return Sum value of one column from cells not blank in another column
I have a table with Net and Gross data in 2 columns. In the rest of the columns there are years (2010,2011,2012,2013). For the years that have a 1 (and is not blank) is it possible to sum the corresponding values from Net or gross on the same row. Without using a pivot table. Please look at the attached example. Probably easy to do, but I am rubbish on excel! |
#2
|
|||
|
|||
I am also a bit rubbish with Excel :-)
But, perhaps something like this would work:- =IF(D2=1;A2+A5;0) returns -6 =IF(D5=1;B2+B5;0) returns 4 And IF(D6=1;B3+B6;0) leaves the cell blank So when they are strung together, the Gross Data B2:B8 column would look like this:- =IF(D2=1;B2;0)+IF(D3=1;B3;0)+IF(D4=1;B4;0)+IF(D5=1 ;B5;0)+IF(D6=1;B6;0)+IF(D7=1;B7;0)+IF(D8=1;B8) Perhaps someone with some skills can suggest a more "elegant" solution :-) Last edited by bobsone1; 08-13-2014 at 09:36 AM. Reason: add more |
#3
|
|||
|
|||
Use SUMIF
Hi zulugandalf,
You need to use SUMIF function to sum the corresponding values. Please look at attached sheet. Good Luck ---------- Raju Singh New Delhi, India |
#4
|
|||
|
|||
Thanks works great!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to remove blank column | netchie | Word VBA | 4 | 03-14-2013 02:22 PM |
Summing Non Contiguous Cells in a Row or Column | Joe Ottenhof | Excel | 4 | 12-19-2012 04:13 AM |
as the return value of another column, using Listbox? | marreco | Excel Programming | 1 | 03-27-2012 12:48 PM |
Can I change the horizontal scrollbar to scroll smoothly rather than column by column | carpat | Excel | 0 | 01-10-2012 09:34 AM |
Need to search a column for a macth and return a result from a third column | pdfaust | Excel | 2 | 02-03-2011 03:02 PM |