sum if cells have value if there is no value leave it blank

Prasad K

Board Regular
Joined
Aug 4, 2021
Messages
189
Office Version
  1. 2016
  2. 2007
Platform
  1. Windows
sum if cells have number value & if there is no numbers in cell then leave it blank cell




Create Folder and Sub Folders.xlsm
ABC
1Test-UTest-BTotal Sum
2213
322
4325
511
60
711
80
9246
1011
Sheet2
Cell Formulas
RangeFormula
C2:C10C2=SUM(A2:B2)
 

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.
Try
=IF(AND(A2="",B2=""),"",A2+B2)
 
Upvote 0
Seems a bit pointless really
VBA Code:
Sub MM1()
With Range("C2:C10")
    .Formula = "=IF(AND(A2="""",B2=""""),"""",A2+B2)"
    .Value = .Value
End With
End Sub
 
Upvote 0
Seems a bit pointless really
VBA Code:
Sub MM1()
With Range("C2:C10")
    .Formula = "=IF(AND(A2="""",B2=""""),"""",A2+B2)"
    .Value = .Value
End With
End Sub
what do mean we can't ask a question like this
 
Upvote 0
No I mean that using VBA to carry out a native Excel function seems pointless
The formula can be inserted in 1 cell to apply to ALL other cells in the column......why use VBA to do the same thing
 
Upvote 0
No I mean that using VBA to carry out a native Excel function seems pointless
The formula can be inserted in 1 cell to apply to ALL other cells in the column......why use VBA to do the same thing
yes your correct & why i asked for vba if i apply formula in cell and when i edit that cell it will display formula if i apply with vba then it's never display formula in cell when i edit that cell

and i am sorry for my previous reply to you

once again thank you much for your help
 
Upvote 0
No need for apologies....I simply didn't want you to have to use VBA if it wasn't necessary...(y)(y):cool:
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,816
Members
449,049
Latest member
cybersurfer5000

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