ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formula in Excel Help Please (https://www.excelbanter.com/excel-worksheet-functions/232282-formula-excel-help-please.html)

TMansell

Formula in Excel Help Please
 
I need a formula the says, If these cells F4:K4 have blanks then they = 0 if
there are no blanks then = $62.50. How do i do this?
--
TMansell

Mike H

Formula in Excel Help Please
 
Hi,

This is far from clear but try this

=IF(COUNTA(F4:K4)=6,62.5,0)

Mike

"TMansell" wrote:

I need a formula the says, If these cells F4:K4 have blanks then they = 0 if
there are no blanks then = $62.50. How do i do this?
--
TMansell


Bernard Liengme[_3_]

Formula in Excel Help Please
 
Not sure I understand. You have cells F4:K4 with either blanks or values.
You want to change theses cells or other cells?

Easy case: change other cells
In some other cell (say F5) enter =IF(ISBLANK(F4),0,62.50)
Format the cell as currency
Copy the formula across the row

Change the actual cells: that will require VBA

Sub tryme()
myrow = 4
For mycol = 6 To 10
If Cells(myrow, mycol).Value = "" Or Cells(myrow, mycol).Value = 0 Then
Cells(myrow, mycol).Value = 0
Else
Cells(myrow, mycol).Value = 62.5
Cells(myrow, mycol).NumberFormat = "$#,##0.00_);($#,##0.00)"
End If
Next
End Sub

New to VBA? See one or both of these:
David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish's "Adding Code to a Workbook"
http://www.contextures.com:80/xlvba01.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"TMansell" wrote in message
...
I need a formula the says, If these cells F4:K4 have blanks then they = 0
if
there are no blanks then = $62.50. How do i do this?
--
TMansell




Jas

Formula in Excel Help Please
 


"TMansell" wrote:

I need a formula the says, If these cells F4:K4 have blanks then they = 0 if
there are no blanks then = $62.50. How do i do this?
--
TMansell



I'm not sure if I understand, but an if statement will work, If (F4="
",0,62.50) for that single cell, but you have more than a single cell. So
normally, when I'm using an if statement it reflects a given cell, but it has
a column of data, you are showing more than just one column of data, given
your cell references F4:K4). F4:F66, would be more like it, then you just
copy down, for each cell. If you have two columns of data, that wouldn't
change the formula but it would changed the cell reference in the formula.


All times are GMT +1. The time now is 06:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com