Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Subtracting cells C2 thru I2
Example: If C2 had 3436, D2 had 3395, E2 had 3376, then I need the answer in cell J2 to be 60 EVEN IF THE CELLS F2 THRU I2 ARE BLANK. This formula works fine if I have numbers in ALL cells (C2:I2) "=MAX(C2:H2)-I2" but when there are blank cell it doesn't count right. Thanks in advance! |
#2
![]() |
|||
|
|||
![]()
Richard
If I have understood your question correctly, this formula entered in J2 will do the trick. =MAX(OFFSET(C2,,,,COUNTA(C2:I2)-1))-OFFSET(C2,,COUNTA(C2:I2)-1) You can't have for instance a number in C2, D2 blank and a number in E2. The blanks are supposed to come between the last filled cell in C2:I2 and J2. -- Best Regards Leo Heuser Followup to newsgroup only please. "Richard" skrev i en meddelelse ... Subtracting cells C2 thru I2 Example: If C2 had 3436, D2 had 3395, E2 had 3376, then I need the answer in cell J2 to be 60 EVEN IF THE CELLS F2 THRU I2 ARE BLANK. This formula works fine if I have numbers in ALL cells (C2:I2) "=MAX(C2:H2)-I2" but when there are blank cell it doesn't count right. Thanks in advance! |
#3
![]() |
|||
|
|||
![]()
How about =max(C2:I2)-MIN(C2:I2)
This should work because MIN ignores the empty cells -- Gary's Student "Leo Heuser" wrote: Richard If I have understood your question correctly, this formula entered in J2 will do the trick. =MAX(OFFSET(C2,,,,COUNTA(C2:I2)-1))-OFFSET(C2,,COUNTA(C2:I2)-1) You can't have for instance a number in C2, D2 blank and a number in E2. The blanks are supposed to come between the last filled cell in C2:I2 and J2. -- Best Regards Leo Heuser Followup to newsgroup only please. "Richard" skrev i en meddelelse ... Subtracting cells C2 thru I2 Example: If C2 had 3436, D2 had 3395, E2 had 3376, then I need the answer in cell J2 to be 60 EVEN IF THE CELLS F2 THRU I2 ARE BLANK. This formula works fine if I have numbers in ALL cells (C2:I2) "=MAX(C2:H2)-I2" but when there are blank cell it doesn't count right. Thanks in advance! |
#4
![]() |
|||
|
|||
![]()
"Gary's Student" skrev i en
meddelelse ... How about =max(C2:I2)-MIN(C2:I2) This should work because MIN ignores the empty cells -- Gary's Student The expression MAX(C2:H2) in the OP's formula indicates, that the numbers from C2 to H2 are not always in descending order, else he would have used C2 instead of MAX(C2:H2), I guess. LeoH |
#5
![]() |
|||
|
|||
![]()
If the situation
You can't have for instance a number in C2, D2 blank and a number in E2. arises, enter 0 (zero) in D2 LeoH |
#6
![]() |
|||
|
|||
![]()
YES! Now that works. Thanks so much Leo!! Don't understand it but it works
"Leo Heuser" wrote: Richard If I have understood your question correctly, this formula entered in J2 will do the trick. =MAX(OFFSET(C2,,,,COUNTA(C2:I2)-1))-OFFSET(C2,,COUNTA(C2:I2)-1) You can't have for instance a number in C2, D2 blank and a number in E2. The blanks are supposed to come between the last filled cell in C2:I2 and J2. -- Best Regards Leo Heuser Followup to newsgroup only please. "Richard" skrev i en meddelelse ... Subtracting cells C2 thru I2 Example: If C2 had 3436, D2 had 3395, E2 had 3376, then I need the answer in cell J2 to be 60 EVEN IF THE CELLS F2 THRU I2 ARE BLANK. This formula works fine if I have numbers in ALL cells (C2:I2) "=MAX(C2:H2)-I2" but when there are blank cell it doesn't count right. Thanks in advance! |
#7
![]() |
|||
|
|||
![]()
You're welcome, Richard, and thanks for the feedback :-)
LeoH "Richard" skrev i en meddelelse ... YES! Now that works. Thanks so much Leo!! Don't understand it but it works |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subtraction Question | Excel Discussion (Misc queries) | |||
Hints And Tips For New Posters In The Excel Newsgroups | Excel Worksheet Functions | |||
Question about combining data from multiple workbooks into one rep | Excel Discussion (Misc queries) | |||
An easy macro question and one I believe to be a little more diffi | Excel Worksheet Functions | |||
Formula Question.....PLEASE PLEASE help! | Excel Discussion (Misc queries) |