Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel b74=b74+1 when b4-b54 ="Y"
i want to add 1 to b74 each time any cell b4-b54 is equal to "Y".
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel b74=b74+1 when b4-b54 ="Y"
Hi lisa_p -
For an instantaneous count, you could use the following formula in cell B74: =COUNTIF(B4:B54,"Y") If you want to add counts the count already in cell B74, you could try the following VB procedu Sub lisa_p() Range("B74") = Range("B74") + _ WorksheetFunction.CountIf(Range("B4:B54"), "Y") End Sub -- Jay "lisa_p" wrote: i want to add 1 to b74 each time any cell b4-b54 is equal to "Y". |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel b74=b74+1 when b4-b54 ="Y"
One way:
=COUNTIF(B4:B54,"Y") In article , lisa_p wrote: i want to add 1 to b74 each time any cell b4-b54 is equal to "Y". |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel b74=b74+1 when b4-b54 ="Y"
You can't have a function reference itself. This is called circular
reference. What you can do is a worksheet change function that can detect when either B4 or B54 is changed. I didn't know what "Y" was so I changed it to 34 Sub worksheet_change(ByVal Target As Range) If Target.Row = 4 And Target.Column = 2 Then If ActiveSheet.Cells(4, 2) - ActiveSheet.Cells(54, 2) = 34 Then ActiveSheet.Cells(74, 2) = ActiveSheet.Cells(74, 2) + 1 End If End If If Target.Row = 54 And Target.Column = 2 Then If ActiveSheet.Cells(4, 2) - ActiveSheet.Cells(54, 2) = 34 Then ActiveSheet.Cells(74, 2) = ActiveSheet.Cells(74, 2) + 1 End If End If End Sub "lisa_p" wrote: i want to add 1 to b74 each time any cell b4-b54 is equal to "Y". |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! | Excel Discussion (Misc queries) | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |