+ Reply to Thread
Results 1 to 2 of 2

If then add 1?

  1. #1
    Registered User
    Join Date
    10-09-2006
    Posts
    1

    Cool If then add 1?

    I need to create a formula to add to a total field if Yes is entered in another.
    Example:
    If y is entered in A1 then Total of C1 increases by 1.

    Objective is to record number of games played by individual players throughout the season.

    Therefore as I see it:
    If A1="y" then c1 + 1, else no change to c1.

    Hope this makes some kind of sense. How do I write this using the formula reference cell value in the calculation.
    I can't get it to work for me.

    Thank you so much.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    Place the macro in a worksheet module
    Each time a y is placed in A1 the cell C1 will increase by 1


    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = ("$A$1") Then
    If Target = "y" Then
    Range("C1").Value = Range("C1").Value + 1
    End If
    End If
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1