How to make cell Result as Blank, if one of sum of cells have no value

pankajgrover

Board Regular
Joined
Oct 27, 2022
Messages
99
Office Version
  1. 365
Platform
  1. Windows
How to make cell Result as Blank, if one of sum of cells have no value. In below example i want D3 and D4 should be result as blank until a3 and b4 have some values. Thanks
Shares Trading.xlsx
ABCD
1ItemABTotal
2pen250035001000
3pencil50005000
4rubber4000-4000
Sheet1
Cell Formulas
RangeFormula
D2:D4D2=C2-B2
 
@Sufiyan97 Hi, In below example how to use IFERROR or any other function to resolve issue #VALUE! in R Column below:

Shares Trading.xlsx
ABGHMNOQR
10Crude Oil100.000.56162.000.56209.0025047.002100
11Crude Oil100.000.56197.000.56610.00250413.0020400
12   #VALUE!
13Natural Gas1250.001433.001437.105004.104625
14Natural Gas1250.001425.00 5.40#VALUE!
15   #VALUE!
16   #VALUE!
KK
Cell Formulas
RangeFormula
B10:B16B10=IFERROR(VLOOKUP(A10,Prices!$A$2:$D$25,2,0),0)
O10:O16O10=IF(AND(N10<>"",H10<>""),C10*M10,"")
Q10:Q16Q10=IF(N10="",D10,N10)-IF(H10="",D10,H10)
R10:R16R10=Q10*IF(M10="",G10,M10)*B10-O10
Named Ranges
NameRefers ToCells
Shares=OFFSET(Prices!$A$2,0,0,COUNTA(Prices!$A$2:$A$25))B10:B16
Cells with Data Validation
CellAllowCriteria
A10:A16List=Shares
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
So in R14 there is no error and it's showing blank?
Here hv data and calculation in R14. Now what i did, this R colmn. depends on O10. I changed O10 formula from =IF(AND(N10<>"",H10<>""),C10*M10,"") to =IF(AND(N10<>"",H10<>""),C10*M10,0) so that this column represent 0 in all blank ones and after that i did not use iferror option in R column. And after that R14 also showing calculated data. But after this R Col. Blank cell shoes 0. In order to tackle 0 i format Col. R as 0;-0;;@,
This way i manage this.. But i am thinking that is there was any alternate way also to tackle this issue ?
 
Upvote 0
You can use this in column R but this will double your formula

=IF("YourFormula"=0,"","YourFormula")
 
Upvote 0
Try

Excel Formula:
=IF(Q10*IF(M10="",G10,M10)*B10-O10=0,"",Q10*IF(M10="",G10,M10)*B10-O10)
 
Upvote 0
Try

Excel Formula:
=IF(Q10*IF(M10="",G10,M10)*B10-O10=0,"",Q10*IF(M10="",G10,M10)*B10-O10)
hi @Sufiyan97 and @Peter_SSs , I just checked this, still not worked for me.. here excel now. i want S column result in R column exactly. how to fix this


Shares Trading.xlsx
ABCDGHMNOQRS
2NameUnitsBrokLPQtyPriceS.QtyS.PriceBrok.Diff.P&LResult should be
10Crude Oil100.00500.006621.000.56162.000.56209.00250.0047.0021002100
11Crude Oil100.00500.006621.000.56197.000.56610.00250.00413.002040020400
16     #VALUE!
22Natural Gas1250.00500.00430.401433.001437.10500.004.1046254625
23Natural Gas1250.00500.00430.401425.00 5.40#VALUE!6750
kk
Cell Formulas
RangeFormula
B10:B11,B16,B22:B23B10=IFERROR(VLOOKUP(A10,Prices!$A$2:$D$25,2,0),0)
C10:C11,C16,C22:C23C10=IFERROR(VLOOKUP(A10,Prices!$A$2:$D$25,3,0),0)
D10:D11,D16,D22:D23D10=IFERROR(VLOOKUP(A10,Prices!$A$2:$D$25,4,0),0)
O10:O11,O16,O22:O23O10=IF(AND(N10<>"",H10<>""),C10*M10,"")
Q10:Q11,Q16,Q22:Q23Q10=IF(N10="",D10,N10)-IF(H10="",D10,H10)
R10:R11,R16,R22:R23R10=Q10*IF(M10="",G10,M10)*B10-O10
Named Ranges
NameRefers ToCells
Shares=OFFSET(Prices!$A$2,0,0,COUNTA(Prices!$A$2:$A$25))B10:D11, B16:D16, B22:D23
Cells with Data Validation
CellAllowCriteria
A3:A23List=Shares
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,728
Members
449,465
Latest member
TAKLAM

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