combine max and indirect?

handysmurf

Board Regular
Joined
Jan 17, 2015
Messages
89
Office Version
  1. 365
Platform
  1. Windows
ok this does not work but I'll post it so you can see what I'm trying to do, returns #REF

"=IF(OR(W886="cp",W886="f",W886="m",W886="o",W886="of",W886="sf"),MAX(AH$5:ROW()-1)+1,"")"

If you don't follow what that is trying to do... I keep track of mileage and expenses for a business vehicle. I link receipts for those expenses and give the receipt a number so I can clearly reference a specific receipt on reports. So the idea is that the formula automatically inserts a number if the line item is an expense and numbers them sequentially. Right now the max part is "MAX(AH$5:AH[row above])+1" but if I have to move around a line then it gets all screwed up and I am trying to avoid this with a formula. I guess because I'm moving and inserting the row it screws it up.

TIA
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Autocorrected to "=MAX(AJ$5:INDEX(AJ:AJ,ROW()-1))+1" but that works Thanks!!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,988
Messages
6,122,620
Members
449,092
Latest member
amyap

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