Increment a line item number by 0.1 depending on value (1 Viewer)

roccoau

Registered User.
Local time
Tomorrow, 01:37
Joined
Sep 1, 2006
Messages
56
Hi
I would like to Increment a line item number by 0.1 depending on value in a particular field. The Field in question will have a "S" or an "N"
When its an "N" I would like the preceding number to be incremented by 0.1
E.g
Item No Code
1 S
2 S
3 S
3.1 N
3.2 N
4 S
5 S
5.1 N
The code I am using is =IF(B2="N",A1+0.1, A1+1)
This is not working properly for me as numbers just keep incrementing once I get to first "N"
Any advice how to tweak it please
TKS
 

sneuberg

AWF VIP
Local time
Today, 09:07
Joined
Oct 17, 2014
Messages
3,506
That code produces
Code:
1	S
2	S
3	S
3.1	N
3.2	N
4.2	S
5.2	S
5.3	N
5.4	N

on my system which is exactly what the code says to do. If that's not what you want what's the rule for when it's "S". Is it the next largest whole number?
 

roccoau

Registered User.
Local time
Tomorrow, 01:37
Joined
Sep 1, 2006
Messages
56
Hi thanks for reply
When its "S" I need it to be the next whole number

EG

Item
1 S
2 S
3 S
3.1 N
4 S
5 S
5.1 N
5.2 N
6 S
 

sneuberg

AWF VIP
Local time
Today, 09:07
Joined
Oct 17, 2014
Messages
3,506
Code:
=IF(B2="N", A1+0.1,INT(A1+1))

Produces the sequence in your post but I suggest testing it with more values it to make sure it does what you want.
 

roccoau

Registered User.
Local time
Tomorrow, 01:37
Joined
Sep 1, 2006
Messages
56
Thanks mate works perfect exactly what I wanted it to do
 

Users who are viewing this thread

Top Bottom