# formula help

#### sam__gleeson

##### Board Regular
Hi

Formula needed in sheet "Performance" D21 .... will drag formula across to Z21

Sheet "Performance" C21 = Work Hours - Days
Sheet "Performance" D20 = Date

Sheet "Main" C5 = Todays() Date
Sheet "Main" B6 = Work Hours - Days
Sheet "Main" C6 = 8

I need D21 to look at "Performance" D20 date and match it to Main" C5 = Date + "Performance" C21 = Work Hours - Days to match "Main" B6 = Work Hours - Days and if they all match place the number in "Main" C6 into "Performance" D21

I get it to work except when the date changes to the next day it wipes out all previous numbers...is it possible that when a number is entered in D21:Z21 that the number remains there even when the date advances daily

Code:
``=IFERROR(INDEX(MAIN!\$B\$5:\$C\$8,MATCH(\$C21,MAIN!\$B\$5:\$B\$8,0),MATCH(D\$20,MAIN!\$C\$4:\$C\$8,0)),0)``

Thanks

Last edited:

### Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

#### bewsh1987

##### Board Regular
I have built what you mentioned and I do get what your saying and it will never work sorry to be so blunt, you may have to change the whole way of your workings.

you will only ever have one cell that will give you a value in sheet "Performance"

will try to look at a better method,

can you not have this work on one sheet instead of the two?

I take it the 8 is classed a s a day

Last edited:

#### sam__gleeson

##### Board Regular
Hi

Yes 8 hr day

Unfortunately No i need both sheets

Thank you

I have a userform which sends data to a sheet.....can the same userform form send data to 2 different sheets in the 1 go??

#### bewsh1987

##### Board Regular
you will have to get your code to select a different sheet then perform your code

Code:
``````Sheets("Performance").Select

Sheets("Main")select``````

Thank you

Replies
1
Views
702
Replies
2
Views
323
Replies
5
Views
205
Replies
0
Views
491
Replies
4
Views
333

1,171,462
Messages
5,875,652
Members
433,145
Latest member
nzltrippa

### 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.

### Which adblocker are you using?

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

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