combine max and indirect?

handysmurf

Board Regular
Joined
Jan 17, 2015
Messages
114
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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
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,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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