IF Function Question

Farro

New Member
Joined
Jan 14, 2016
Messages
13
Hello,

I am building a function to where I would like a cell to reflect differently depending on what another cell reflects. Simple I know but the kicker is that I would like it so that is the cell does not equal a specific word then the cell will reflect a normal addition sequence of data:

I have provided an example below and I will explain.


If C3 (PTO) is equal to PTO then G3 equals 8:00. If cell C3 was not equal to PTO then G3 would reflect the formula =SUM(D3-C3)+(F3-E3).
[TABLE="width: 547"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]

[/TD]
[/TR]
[TR]
[TD]WEEK TOTAL[/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="width: 547"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]
B C D E F G
[TABLE="width: 547"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]DAY[/TD]
[TD]LOGIN[/TD]
[TD]LUNCH OUT[/TD]
[TD]LUNCH IN[/TD]
[TD]LOGOUT[/TD]
[TD]Total[/TD]
[/TR]
[TR]
[TD]MONDAY[/TD]
[TD]PTO[/TD]
[TD]N/A[/TD]
[TD]N/A[/TD]
[TD]N/A[/TD]
[TD]8:00[/TD]
[/TR]
[TR]
[TD]TUESDAY [/TD]
[TD]9:22 AM[/TD]
[TD]1:00 PM[/TD]
[TD]1:30 PM[/TD]
[TD]6:36 PM[/TD]
[TD]8:44[/TD]
[/TR]
[TR]
[TD]WEDNESDAY[/TD]
[TD]9:34 AM[/TD]
[TD]1:00 PM[/TD]
[TD]1:30 PM[/TD]
[TD]6:30 PM[/TD]
[TD]8:26[/TD]
[/TR]
[TR]
[TD]THURSDAY[/TD]
[TD]9:07 AM[/TD]
[TD]1:00 PM[/TD]
[TD]1:30 PM[/TD]
[TD]5:40 PM[/TD]
[TD]8:03[/TD]
[/TR]
[TR]
[TD]FRIDAY[/TD]
[TD]9:17 AM[/TD]
[TD]1:00 PM[/TD]
[TD]1:30 PM[/TD]
[TD]4:35 PM[/TD]
[TD]6:48[/TD]
[/TR]
[TR]
[TD]WEEK TOTAL[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]32:01:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]


I essentially want my formulas to act as normal unless the C column reflects PTO in which it creates an automatic 8 hours.
 

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"
if c3 (pto) is equal to pto then g3 equals 8:00. If cell c3 was not equal to pto then g3 would reflect the formula =sum(d3-c3)+(f3-e3)

=if( c3 = "pto" , timevalue("8:00") , sum(d3-c3)+(f3-e3))
 
Last edited:
Upvote 0
You only use the SUM formula on a range of cells (i.e. SUM(A1:A10)).
You really don't need to use it at all on your formula (it is totally unnecessary).
Just use:
D3-C3+F3-E3
for that part of your calculation.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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