# Using Code with Nested formulas

#### autigers

##### Board Regular
I am attempting to use the following formulas in code on a worsheet change event.
IF(E23="","",IF(G23="","",IF(G23<F23,IF(H23="",G23+1-F23,(G23+1)-(F23+\$V\$5)),IF(H23="",G23-F23,G23-(F23+\$V\$5)))))

This formula simply looks at Start times, Finish Times and whether or not a lunch was taken. And then performs the math accordingly based on times and whether or not time is less than midnight etc .. (Time is tricky in excel)

What I would like to do is take the data from sheet "Input" and using the formula above in code, perform the function ...

After this I have other formulas I would like to do the same and then take all data from sheet"Input" and transfer/ Sum again data to multiple sheets ...

### Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
My formula won't paste correctly into my message ....

=IF(E23="","",IF(G23
="","",IF(G23<F23,IF
(H23="",G23+1-F23,
(G23+1)-(F23+\$V\$5)
),IF(H23="",G23-F23,
G23-(F23+\$V\$5)))))

Heres a sample of the sheet
TimeTrac.xls
ABCDEFG
1WMS LogonOTJobStartFinishLunchJob Hours
2APPJCLD7:45 PM12:00 AM4:15
DailyInput

Replies
3
Views
321
Replies
0
Views
76
Replies
4
Views
218
Replies
6
Views
243
Replies
12
Views
474

1,206,826
Messages
6,075,094
Members
446,119
Latest member
BrianAndrews

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