Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to calculate percentages that a column of values are of a
single cell value, e.g. column a contains values 10 through 100 column b will contain the percentage that a is of a cell C6 I'm trying to populate the cell formulas in column B with an =IF(... formula, is that possible, I tried this for n = 1 to 10 Cells(n, 2).Formula = "=IF(C6, Cells(n, 1).Value / cells(6,3).value & , 0)" next But that won't work, I've tried a few other things, I want the sheet to update when different values are entered into C6, with the percentages if C6 is not empty, and with 0's if c6 is empty. Does anyone have any suggestions? TIA, Mike |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You won't be able to use a .value in the value of a cell I don't think. Here is a snippet of code that I used recently where I put an if statement in a cell.
Sheet5.Cells(row_tag + 1, col_tag + 1).Value = "=IF('Introduction'!B7<"""",'Introduction'!B7 , ""N/A"")" Sheet5.Cells(row_tag + 3, col_tag + 1).Value = "=IF('LoTo Procedure #" & page_number & "'!C" & cell_data & "<"""",'LoTo Procedure #" & page_number & "'!C" & cell_data & ", ""N/A"")" Sheet5.Cells(row_tag + 5, col_tag + 1).Value = "=IF('LoTo Procedure #" & page_number & "'!B" & cell_data & "<"""",'LoTo Procedure #" & page_number & "'!B" & cell_data & ", ""N/A"")" Sheet5.Cells(row_tag + 21, col_tag + 1).Value = "=IF('LoTo Procedure #" & page_number & "'!D" & cell_data & "<"""",'LoTo Procedure #" & page_number & "'!D" & cell_data & ", ""N/A"")" Sheet5.Cells(row_tag + 25, col_tag + 1).Value = "=IF('LoTo Procedure #" & page_number & "'!F" & cell_data & "<"""",'LoTo Procedure #" & page_number & "'!F" & cell_data & ", ""N/A"")" |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps...
In B10: =IF($C$6,$A10/$C$6,0) ...and copy down! -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
change formula dynamically | Excel Programming | |||
How can I dynamically change a file link in a formula? | Excel Worksheet Functions | |||
Macro Copying Rows That Change Dynamically | Excel Programming | |||
Dynamically Change date in Formula | Excel Worksheet Functions | |||
Dynamically change cell range in formula by background color? | Excel Programming |