Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i know i've seen something like this, but i don't know if it's sum(if,
sumif, or sumproduct: anyway 2 columns of numbers i need to add up the 1st column, but if the number in the cell to the right of it is greater than that number, i need to add that number instead. 1 0 2 0 3 5 4 0 12 should be the sum thanks -- Gary |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gary,
The first thing that comes to mind is to add a column of formulas to the right (Column C if the other two Columns are A and B). The formula would be: =IF(A1<B1,B1,A1) This will return the value in B1 if it's greater than A1, or A1 if it's bigger. Then SUM the values in Column C to get your total (12 as shown in your example). If I think of a way to do it without adding a Column I'll post up. This is what popped into my head first. Hope that helps. Regards, James "Gary Keramidas" wrote: i know i've seen something like this, but i don't know if it's sum(if, sumif, or sumproduct: anyway 2 columns of numbers i need to add up the 1st column, but if the number in the cell to the right of it is greater than that number, i need to add that number instead. 1 0 2 0 3 5 4 0 12 should be the sum thanks -- Gary |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i guess that's one way of doing it, thanks james
-- Gary "JS2004R6" wrote in message ... Hi Gary, The first thing that comes to mind is to add a column of formulas to the right (Column C if the other two Columns are A and B). The formula would be: =IF(A1<B1,B1,A1) This will return the value in B1 if it's greater than A1, or A1 if it's bigger. Then SUM the values in Column C to get your total (12 as shown in your example). If I think of a way to do it without adding a Column I'll post up. This is what popped into my head first. Hope that helps. Regards, James "Gary Keramidas" wrote: i know i've seen something like this, but i don't know if it's sum(if, sumif, or sumproduct: anyway 2 columns of numbers i need to add up the 1st column, but if the number in the cell to the right of it is greater than that number, i need to add that number instead. 1 0 2 0 3 5 4 0 12 should be the sum thanks -- Gary |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gary
The array entered formula, (commit with Control-Shift-Enter, not just Enter) {=SUM(IF(G1:G4H1:H4,G1:G4,H1:H4)))} Don't enter the curly braces { }, Excel will include them when you use Ctrl-Shift-Enter Regards Roger Govier Gary Keramidas wrote: i know i've seen something like this, but i don't know if it's sum(if, sumif, or sumproduct: anyway 2 columns of numbers i need to add up the 1st column, but if the number in the cell to the right of it is greater than that number, i need to add that number instead. 1 0 2 0 3 5 4 0 12 should be the sum thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks roger, i was close
i didn't save any of my attempts, but i think i had the same references as you, but i think i was using sumproduct,. thanks -- Gary "Roger Govier" wrote in message ... Hi Gary The array entered formula, (commit with Control-Shift-Enter, not just Enter) {=SUM(IF(G1:G4H1:H4,G1:G4,H1:H4)))} Don't enter the curly braces { }, Excel will include them when you use Ctrl-Shift-Enter Regards Roger Govier Gary Keramidas wrote: i know i've seen something like this, but i don't know if it's sum(if, sumif, or sumproduct: anyway 2 columns of numbers i need to add up the 1st column, but if the number in the cell to the right of it is greater than that number, i need to add that number instead. 1 0 2 0 3 5 4 0 12 should be the sum thanks |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=SUM(IF(A1:A10B1:B10,A1:A10,B1:B10))
as an array formula, so commit with Ctrl-Shift-Enter -- HTH Bob Phillips "Gary Keramidas" wrote in message ... i guess that's one way of doing it, thanks james -- Gary "JS2004R6" wrote in message ... Hi Gary, The first thing that comes to mind is to add a column of formulas to the right (Column C if the other two Columns are A and B). The formula would be: =IF(A1<B1,B1,A1) This will return the value in B1 if it's greater than A1, or A1 if it's bigger. Then SUM the values in Column C to get your total (12 as shown in your example). If I think of a way to do it without adding a Column I'll post up. This is what popped into my head first. Hope that helps. Regards, James "Gary Keramidas" wrote: i know i've seen something like this, but i don't know if it's sum(if, sumif, or sumproduct: anyway 2 columns of numbers i need to add up the 1st column, but if the number in the cell to the right of it is greater than that number, i need to add that number instead. 1 0 2 0 3 5 4 0 12 should be the sum thanks -- Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Commenting custom formula fields/formula on formula editor | Excel Programming |