Should i use IF statements?

petethecat

Board Regular
Joined
Oct 25, 2011
Messages
63
Hi All,
I have a sheet where i have a column with mix of Letters & numbers. in another column I want to assign a number to the letter (in this instance it is an "R" & i want to give this a value of 1) & i want to increase the values of the occupied cells by one. So i want to change a 1 to a two, a 2 to a three etc. To complicate maters i have a series of Zero values that i also want to assign a value to but i want to give them a value next in sequence AFTER the other numbers. So if my last number is a 5 (now updated to a six) i want the next value to be 7.

I have tried using a long IF statement but it is not really working 100%.
=IF(K19=0,0,IF(K19="R",1,IF(K19=1,2,IF(K19=2,3,IF(K19=3,4,IF(K19=4,5,IF(K19-5,6,IF(K19=6,7,IF(K19=7,8,IF(K19=8,9,IF(K19=9,10)))))))))))

This of course doesn't deal with the zeros in any useful way.

I am a bit of a novice with this kind of thing so any help would be appreciated!
 
This updated formula will accommodate data With Or Without "R":


Book1
DE
122
207
344
455
511
633
708
809
9010
10011
1166
Sheet620
Cell Formulas
RangeFormula
E1=IF(D1="R",1,IF(D1=0,MAX(D$1:D$11)+COUNTIF(D$1:D1,0)+IF(COUNTIF(D$1:D$11,"R"),1,0),D1+IF(COUNTIF(D$1:D$11,"R"),1,0)))


Formula copied down.
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,213,565
Messages
6,114,338
Members
448,570
Latest member
rik81h

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top