# Four answers in one formula?

#### bpflyr

##### Board Regular
Sorry, I just posted a question very similar to this, but I had not thought it all the way through. Here's what I'm trying to do in one formula:

IF LEN(J138)=0, then return F138
IF LEN(J138)>0, then SUM(E138-J138). IF that result is 0, then be blank.
IF LEN(F138)=0, then be blank

Thank you!!

### Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

You almost wrote out verbatim what the formula would look like.

=if(len(f138)=0,"",if(len(J138)=0,F138,if(len(J138)>0,sum(E138:J138),"")))

the basic construct of IF in Excel is:

IF(condition, true-result, false-result)

You can "nest" up to 6 or 7 different IF statement. (Forget the actual number).

bpflyr

Could you try and stick to 1 thread?

I know this one is slighty different but they are related.

Hi bpflyr:

It is not a good idea to start another thread on the same type of question. Anyway, how about ...

=IF(F138=0,"",IF(LEN(J138)=0,F138,IF(E138-J138,E138-J138,"")))

bpflyr said:
Sorry, I just posted a question very similar to this, but I had not thought it all the way through. Here's what I'm trying to do in one formula:

IF LEN(J138)=0, then return F138
IF LEN(J138)>0, then SUM(E138-J138). IF that result is 0, then be blank.
IF LEN(F138)=0, then be blank

Thank you!!

=IF(J138="",IF(F138="","",F138),IF(E138-J138,E138-J138,""))

bpflyr

Replies
2
Views
123
Replies
2
Views
72
Replies
4
Views
117
Replies
2
Views
224
Replies
3
Views
211

1,203,455
Messages
6,055,540
Members
444,794
Latest member
HSAL

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back