ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Increasing number depending on input (https://www.excelbanter.com/excel-worksheet-functions/209563-increasing-number-depending-input.html)

n_sabra64

Increasing number depending on input
 
Bear with me I am an Excel novice,

I am trying to figure out what formula I need to increase a number in a
certain cell, in response to an input from another cell.

Example:
In Cell C2, If B2 equals 1, I need the number in C2 to increase by 1
......but I also need the number in C2 not to change if another number is
entered.

Basically B2 will increase the numbers in other cells depending on what is
entered.


This is for a survey type form, and I need to track how many 1's, 2's, 3's,
etc. are entered.

Sheeloo[_3_]

Increasing number depending on input
 

What you want can be done using COUNTIF formula

=COUNTIF(B1:B100,1) will give you the count of cells equal to 1
adjust 100 to last row in your data

What you can do is enter 1,2 ... in, say, cell D1, D2,...
then in C1 enter
=COUNTIF(B$1:B$100,D1) and copy to C2, C3 etc.


"n_sabra64" wrote:

Bear with me I am an Excel novice,

I am trying to figure out what formula I need to increase a number in a
certain cell, in response to an input from another cell.

Example:
In Cell C2, If B2 equals 1, I need the number in C2 to increase by 1
.....but I also need the number in C2 not to change if another number is
entered.

Basically B2 will increase the numbers in other cells depending on what is
entered.


This is for a survey type form, and I need to track how many 1's, 2's, 3's,
etc. are entered.


n_sabra64[_2_]

Increasing number depending on input
 


"Sheeloo" wrote:


What you want can be done using COUNTIF formula

=COUNTIF(B1:B100,1) will give you the count of cells equal to 1
adjust 100 to last row in your data

What you can do is enter 1,2 ... in, say, cell D1, D2,...
then in C1 enter
=COUNTIF(B$1:B$100,D1) and copy to C2, C3 etc.


"n_sabra64" wrote:

Bear with me I am an Excel novice,

I am trying to figure out what formula I need to increase a number in a
certain cell, in response to an input from another cell.

Example:
In Cell C2, If B2 equals 1, I need the number in C2 to increase by 1
.....but I also need the number in C2 not to change if another number is
entered.

Basically B2 will increase the numbers in other cells depending on what is
entered.


This is for a survey type form, and I need to track how many 1's, 2's, 3's,
etc. are entered.


n_sabra64[_2_]

Increasing number depending on input
 
Unfortunately I was not clear enough, but I also need the number to not
change in C2 if another number is put in. In other words, D2 will count how
many times 2 is put in B2, and E2 will count how many times 3 is put in B2,
F2......
In other words B2 will change, but I need the tracking Cells to only
increment when their corresponding number is entered and not to reset. I know
I am not explaining this clearly enough, but I appreciate your help.

"Sheeloo" wrote:


What you want can be done using COUNTIF formula

=COUNTIF(B1:B100,1) will give you the count of cells equal to 1
adjust 100 to last row in your data

What you can do is enter 1,2 ... in, say, cell D1, D2,...
then in C1 enter
=COUNTIF(B$1:B$100,D1) and copy to C2, C3 etc.


"n_sabra64" wrote:

Bear with me I am an Excel novice,

I am trying to figure out what formula I need to increase a number in a
certain cell, in response to an input from another cell.

Example:
In Cell C2, If B2 equals 1, I need the number in C2 to increase by 1
.....but I also need the number in C2 not to change if another number is
entered.

Basically B2 will increase the numbers in other cells depending on what is
entered.


This is for a survey type form, and I need to track how many 1's, 2's, 3's,
etc. are entered.


Mike H

Increasing number depending on input
 
Hi,

You need a macro for that. Right click your sheet tab, view code and paste
this in.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$B$2" And IsNumeric(Target) Then
Select Case Target.Value
Case Is = 2
Range("D2").Value = Range("D2").Value + 1
Case Is = 3
Range("E2").Value = Range("E2").Value + 1
End Select
End If
End Sub

Mike

"n_sabra64" wrote:

Unfortunately I was not clear enough, but I also need the number to not
change in C2 if another number is put in. In other words, D2 will count how
many times 2 is put in B2, and E2 will count how many times 3 is put in B2,
F2......
In other words B2 will change, but I need the tracking Cells to only
increment when their corresponding number is entered and not to reset. I know
I am not explaining this clearly enough, but I appreciate your help.

"Sheeloo" wrote:


What you want can be done using COUNTIF formula

=COUNTIF(B1:B100,1) will give you the count of cells equal to 1
adjust 100 to last row in your data

What you can do is enter 1,2 ... in, say, cell D1, D2,...
then in C1 enter
=COUNTIF(B$1:B$100,D1) and copy to C2, C3 etc.


"n_sabra64" wrote:

Bear with me I am an Excel novice,

I am trying to figure out what formula I need to increase a number in a
certain cell, in response to an input from another cell.

Example:
In Cell C2, If B2 equals 1, I need the number in C2 to increase by 1
.....but I also need the number in C2 not to change if another number is
entered.

Basically B2 will increase the numbers in other cells depending on what is
entered.


This is for a survey type form, and I need to track how many 1's, 2's, 3's,
etc. are entered.



All times are GMT +1. The time now is 01:22 AM.

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