Home |
Search |
Today's Posts |
#1
|
|||
|
|||
sum product in an index possibly?
trying to do a formula along the lines of: search column b for "n", if its an
"n" then multilply column d by column c. I need it to include all occurances though. so in the exapmle below it would include eeee, hhhh, and kkkk. does anyone know what a proper formula would be? many thanks. A b c d eeee n 60 1 ffff y 55 2 gggg j 12 1 hhhh n 50 2 iiii j 14 3 jjjj y 14 1 kkkk n 50 1 |
#2
|
|||
|
|||
=SUMPRODUCT(--(B1:B100="n"),C1:C100,D1:D100)
-- HTH RP (remove nothere from the email address if mailing direct) "CMAC" wrote in message ... trying to do a formula along the lines of: search column b for "n", if its an "n" then multilply column d by column c. I need it to include all occurances though. so in the exapmle below it would include eeee, hhhh, and kkkk. does anyone know what a proper formula would be? many thanks. A b c d eeee n 60 1 ffff y 55 2 gggg j 12 1 hhhh n 50 2 iiii j 14 3 jjjj y 14 1 kkkk n 50 1 |
#3
|
|||
|
|||
One way
=SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) Regards Peo Sjoblom "CMAC" wrote: trying to do a formula along the lines of: search column b for "n", if its an "n" then multilply column d by column c. I need it to include all occurances though. so in the exapmle below it would include eeee, hhhh, and kkkk. does anyone know what a proper formula would be? many thanks. A b c d eeee n 60 1 ffff y 55 2 gggg j 12 1 hhhh n 50 2 iiii j 14 3 jjjj y 14 1 kkkk n 50 1 |
#4
|
|||
|
|||
Just curious. Why would you use
=SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) instead of =SUMPRODUCT((B2:B8="n")*(C2:C8*D2:D8)) Is there a speed issue? Or am I missing something else? Thanks, Tim C "Peo Sjoblom" wrote in message ... One way =SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) Regards Peo Sjoblom "CMAC" wrote: trying to do a formula along the lines of: search column b for "n", if its an "n" then multilply column d by column c. I need it to include all occurances though. so in the exapmle below it would include eeee, hhhh, and kkkk. does anyone know what a proper formula would be? many thanks. A b c d eeee n 60 1 ffff y 55 2 gggg j 12 1 hhhh n 50 2 iiii j 14 3 jjjj y 14 1 kkkk n 50 1 |
#5
|
|||
|
|||
I wasn't consistent, Bob's formula was
http://www.mcgimpsey.com/excel/formulae/doubleneg.html -- Regards, Peo Sjoblom (No private emails please, for everyone's benefit keep the discussion in the newsgroup/forum) "Tim C" wrote in message ... Just curious. Why would you use =SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) instead of =SUMPRODUCT((B2:B8="n")*(C2:C8*D2:D8)) Is there a speed issue? Or am I missing something else? Thanks, Tim C "Peo Sjoblom" wrote in message ... One way =SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) Regards Peo Sjoblom "CMAC" wrote: trying to do a formula along the lines of: search column b for "n", if its an "n" then multilply column d by column c. I need it to include all occurances though. so in the exapmle below it would include eeee, hhhh, and kkkk. does anyone know what a proper formula would be? many thanks. A b c d eeee n 60 1 ffff y 55 2 gggg j 12 1 hhhh n 50 2 iiii j 14 3 jjjj y 14 1 kkkk n 50 1 |
#6
|
|||
|
|||
I multiply the terms "manually" instead of separating them with a comma,
thereby forcing the conversion without the double negative. I end up with a single term, with SUMPRODUCT taking care of the adding and the array handling. To me this results in a cleaner, more easily understood formula. Is this just a personal preference or are there advantages to doing it Bob's way? (My formula would be more concise if I took out the last set of parenthesis, but I think the intent of the formula is more easily understood with them in place. This can be very helpful for later troubleshooting or modification.) Tim C "Peo Sjoblom" wrote in message ... I wasn't consistent, Bob's formula was http://www.mcgimpsey.com/excel/formulae/doubleneg.html -- Regards, Peo Sjoblom (No private emails please, for everyone's benefit keep the discussion in the newsgroup/forum) "Tim C" wrote in message ... Just curious. Why would you use =SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) instead of =SUMPRODUCT((B2:B8="n")*(C2:C8*D2:D8)) Is there a speed issue? Or am I missing something else? Thanks, Tim C "Peo Sjoblom" wrote in message ... One way =SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) Regards Peo Sjoblom "CMAC" wrote: trying to do a formula along the lines of: search column b for "n", if its an "n" then multilply column d by column c. I need it to include all occurances though. so in the exapmle below it would include eeee, hhhh, and kkkk. does anyone know what a proper formula would be? many thanks. A b c d eeee n 60 1 ffff y 55 2 gggg j 12 1 hhhh n 50 2 iiii j 14 3 jjjj y 14 1 kkkk n 50 1 |
#7
|
|||
|
|||
Hi
Advantages of using the double minus: - slightly faster (approx. 5%) - no problems if you have text values in your range (e.g. a heading row). The multiplication syntax will fail the double minus not (will ignore text cells) But take a look at: http://www.xldynamic.com/source/xld....CT.html#format -- Regards Frank Kabel Frankfurt, Germany Tim C wrote: I multiply the terms "manually" instead of separating them with a comma, thereby forcing the conversion without the double negative. I end up with a single term, with SUMPRODUCT taking care of the adding and the array handling. To me this results in a cleaner, more easily understood formula. Is this just a personal preference or are there advantages to doing it Bob's way? (My formula would be more concise if I took out the last set of parenthesis, but I think the intent of the formula is more easily understood with them in place. This can be very helpful for later troubleshooting or modification.) Tim C "Peo Sjoblom" wrote in message ... I wasn't consistent, Bob's formula was http://www.mcgimpsey.com/excel/formulae/doubleneg.html -- Regards, Peo Sjoblom (No private emails please, for everyone's benefit keep the discussion in the newsgroup/forum) "Tim C" wrote in message ... Just curious. Why would you use =SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) instead of =SUMPRODUCT((B2:B8="n")*(C2:C8*D2:D8)) Is there a speed issue? Or am I missing something else? Thanks, Tim C "Peo Sjoblom" wrote in message ... One way =SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) Regards Peo Sjoblom "CMAC" wrote: trying to do a formula along the lines of: search column b for "n", if its an "n" then multilply column d by column c. I need it to include all occurances though. so in the exapmle below it would include eeee, hhhh, and kkkk. does anyone know what a proper formula would be? many thanks. A b c d eeee n 60 1 ffff y 55 2 gggg j 12 1 hhhh n 50 2 iiii j 14 3 jjjj y 14 1 kkkk n 50 1 |
#8
|
|||
|
|||
Frank,
Danke. Tim C "Frank Kabel" wrote in message ... Hi Advantages of using the double minus: - slightly faster (approx. 5%) - no problems if you have text values in your range (e.g. a heading row). The multiplication syntax will fail the double minus not (will ignore text cells) But take a look at: http://www.xldynamic.com/source/xld....CT.html#format -- Regards Frank Kabel Frankfurt, Germany Tim C wrote: I multiply the terms "manually" instead of separating them with a comma, thereby forcing the conversion without the double negative. I end up with a single term, with SUMPRODUCT taking care of the adding and the array handling. To me this results in a cleaner, more easily understood formula. Is this just a personal preference or are there advantages to doing it Bob's way? (My formula would be more concise if I took out the last set of parenthesis, but I think the intent of the formula is more easily understood with them in place. This can be very helpful for later troubleshooting or modification.) Tim C "Peo Sjoblom" wrote in message ... I wasn't consistent, Bob's formula was http://www.mcgimpsey.com/excel/formulae/doubleneg.html -- Regards, Peo Sjoblom (No private emails please, for everyone's benefit keep the discussion in the newsgroup/forum) "Tim C" wrote in message ... Just curious. Why would you use =SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) instead of =SUMPRODUCT((B2:B8="n")*(C2:C8*D2:D8)) Is there a speed issue? Or am I missing something else? Thanks, Tim C "Peo Sjoblom" wrote in message ... One way =SUMPRODUCT(--(B2:B8="n"),(C2:C8*D2:D8)) Regards Peo Sjoblom "CMAC" wrote: trying to do a formula along the lines of: search column b for "n", if its an "n" then multilply column d by column c. I need it to include all occurances though. so in the exapmle below it would include eeee, hhhh, and kkkk. does anyone know what a proper formula would be? many thanks. A b c d eeee n 60 1 ffff y 55 2 gggg j 12 1 hhhh n 50 2 iiii j 14 3 jjjj y 14 1 kkkk n 50 1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i turn the help index on again? | Excel Discussion (Misc queries) | |||
Vlookup, Index & Match | Excel Worksheet Functions | |||
If statement needed | Excel Worksheet Functions | |||
index match and sum | Excel Worksheet Functions | |||
index to a range of cells | Excel Worksheet Functions |