简体   繁体   中英

Excel Formula to work out incremental figure defined by various monthly results

I need a formula or VBA to help me calculate the below;

The base rate for ax sale will be £2.00 per sale This will increase by 50p per sale if you deliver 100% attendance in the previous month to a maximum of £5.00 per sale.

Think im along the right lines with a ifand but I am struggling to create the formula to reset values if a poor month attendance is not achieved.

example of sheet

New example enter image description here

Is it something like the following you need:

=J3*(2+MIN(3,(8-MAX(IF(B3:I3<>1,COLUMN(B3:I3)*1-1,0)))*0.5))

(Entered with CTRL + SHIFT + ENTER .)

Update: If you don't want to reference the current (right-most) month in your calculation, use:

=J3*(2+MIN(3,(7-MAX(IF(B3:H3<>1,COLUMN(B3:H3)*1-1,0)))*0.5))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM