# IF & IF

#### Jester 1978

##### New Member
I am trying to set a formula where by the value in cell A1 is copied into A3 to A100.
But it will only show up if there is a value in B3 as well.

I can get it to work doing one or the other but not combined.

I have tried to use:

=IF(\$A\$1=0,"",\$A\$1,IF(B3=0,"",\$A\$1))

Any help on this would be great as it is purely for cosmetic puposes on the spreadsheet, and it is driving me mad!!!!

### Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

=IF(LEN(\$A\$1)*LEN(B3),\$A\$1,"")

_________________
Regards,

Juan Pablo G.
MrExcel.com Consulting
This message was edited by Juan Pablo G. on 2002-09-19 06:51

or: =IF(OR(\$A\$1="",B3 = ""),"",\$A\$1)
_________________
Oh, you hate your job? Why didn't you say so? There's a support group
for that. It's called EVERYBODY, and they meet at the bar. - Drew Carey
This message was edited by zzydhf on 2002-09-19 07:00

=IF(\$A\$1=0,"",IF(\$B\$3=0,"",\$A\$1))

Does it work?

Thansk to both of you.

Hi Jester.

I don't understand what you're trying to do really.

If you want to copy A1 to cells, A3, A4, A5 ... A100 but only if cell B3 is not blank then I think you're going to have to result to a User defined function and VBA. If you just want to copy A1 to A3 if B3 is blank then try this:

=IF(ISBLANK(B3),A1,"")

I don't know a worksheet function which would let you zip through a whole range of cells, for this VBA would be much quicker

Here is a VBA sub

Sub copyit()

If Cells(3, 2).Value <> "" Then
For x = 1 To 10
Cells(3 + x, 1).Value = Cells(1, 1).Value
Next
End If

End Sub

Hope this helps you

Thanks to both of you.

Replies
4
Views
220
Replies
5
Views
139
Replies
6
Views
133
Replies
13
Views
149
Replies
7
Views
556

1,218,576
Messages
6,143,314
Members
450,477
Latest member
teresab543

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

### Which adblocker are you using?

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

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