Incrementing a number based on an IF fundtion

Dan Wilson

Well-known Member
Joined
Feb 5, 2006
Messages
536
Office Version
  1. 365
Platform
  1. Windows
Good day I am using Excel out of Office 365 on Windows10. I have a worksheet that tracks motorcycle rides. The setup is as follows:

Column A - date of a ride. formatted as date.
Column B - ride number. formatted as number with no decimal points. can go as high as three digits.
Column C - ride status. formatted as text.

What I would like to do is have a formula in Column B that examines Column C. If the data in Column C is "D" or "M" or "N", then the number in Column B is to be increased by 1. If the data in Column C is "O" or "C" or "U" then Column B is to be left either empty or have "n/a" inserted. I know how to extrapolate the number in Column B, but not with a blank or "n/a" between the sequence of numbers.

Any help is appreciated.
Thanks, Danno...
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
How about, in B2 copied down
=IF(OR(C2={"D","M","N"}),MAX(B$1:B1)+1,"")
 
Upvote 0
Good day Fluff. Absolutely amazing! Not only does your fix work, it taught me how include more than choice in an IF statement! This forum is the best. That one trick has saved me a lot of work.
Thank you, Danno...
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0
Good day again fluff. After inserting your formula into my workbook, I found that apparently the formula does not want to sort along with the other formulas on the worksheet. So, the user will just have to enter the number manually. I did learn a few things in making it work though, so thanks again, Danno...
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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