Four answers in one formula?

bpflyr

Board Regular
Joined
Nov 7, 2005
Messages
116
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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

nbrcrunch

Well-known Member
Joined
Jan 1, 2003
Messages
2,062
Sounds like your last criteria is actually your first.

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).
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows
bpflyr

Could you try and stick to 1 thread?

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

Yogi Anand

MrExcel MVP
Joined
Mar 12, 2002
Messages
11,454
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,"")))
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
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

Board Regular
Joined
Nov 7, 2005
Messages
116
Thank you so much to everybody. Sorry about the new thread.

bpflyr
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,051
Messages
5,835,137
Members
430,343
Latest member
Sailingexcel

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top