Leaving cell blank ?

JMITCH26

Board Regular
Joined
May 18, 2005
Messages
91
=IF(AND(ISTEXT(F4),ISNUMBER(E4)),E4-60,E4)

The cell leaves a 0 with this current formula the math is fine but I would like the cell to be blank instead of 0. I have tried a few different ways but it keeps showing error.

any help on this would be great.
 

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
Usually a blank would be in the FALSE result where you have E4. What is the value of E4 when the formula returns 0? And are you wanting it to return blank when the conditions are FALSE?

Excel Formula:
=IF(AND(ISTEXT(F4),ISNUMBER(E4)),E4-60,"")
 
Upvote 0
Nothing is in E4 when it returns 0

its a mileage chart

A​
B​
C​
D​
E​
F​
G​
H​
I​
1​
2​
Miles
Distance
Start/End
MQ
-60
Total
Date
Day
3​
1
271215​
Start​
0​
Jun 3, 2024​
Monday​
4​
2
271277​
62​
End​
62​
X​
2​
Jun 3, 2024​
Monday​
5​
3
271277​
Start​
0​
Jun 3, 2024​
Monday​
6​
4
271301​
24​
End​
24​
24​
Jun 3, 2024​
Monday​

Formula is in column G4,
Im asking G4 to look for the letter X in F4
IF there is a letter in F4 then deduct 60 miles from E4 and report the total in G4

it looks like that is working ok
but when I have nothing entered into lets say E5 it returns a 0 I would rather have it be blank
when trying to use a few blank formula so it leaves nothing in the cell I get an error

Thanks for the help on this
I'm sure its some small step I'm leaving out

or maybe there is a better way to wright the whole line
 
Upvote 0
Did you try the modification I suggested to your current formula? You can try it this way too, but it's essentially the same formula:

Excel Formula:
=IF(AND(F4="X",E4<>""),E4-60,"")
 
Upvote 0
=IF(AND(ISTEXT(F4),ISNUMBER(E4)),E4-60,"")

the first one you sent works perfectly sorry I had a typo in it when I first typed it back in

but it works fine now thank you for the help
 
Upvote 0
OK, there is one more thing I noticed when you have the mileage in E6 and you add the X in F6 it will do that math and deduct the the 60 miles and report to G6 perfectly

but when you have the mileage E6 and there is no X in F6, G6 will remain blank instead of showing the mileage from E6

again thanks for the help on this.
 
Upvote 0
Alright, so try this:

Excel Formula:
=IF(AND(ISTEXT(F4),ISNUMBER(E4)),E4-60,IF(E4<>"",E4,""))
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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
Back
Top