Help with If AND OR formula

abberyfarm

Well-known Member
Joined
Aug 14, 2011
Messages
733
Hi,

Could somebody help me with an IF, AND, OR formula please.

I have data for car journeys ike this:

Car registration in Col A, and Start and stop times etc.

Sheet1

*ABCDEFG
1VehicleStart DateStart TimeStop DateStop TimeParking timeParking time if next journey is on same day or next day only
210D1449904/01/201108:01:0804/01/201108:23:5109:22:00*
310D1449904/01/201117:46:3404/01/201118:15:1213:46:54*
410D1449905/01/201108:02:0605/01/201108:26:2009:05:39*
510D1449905/01/201117:31:5905/01/201118:06:1014:10:15*
610D1449906/01/201108:16:2506/01/201108:45:1705:10:47*
710D1449906/01/201113:56:0406/01/201114:10:3101:19:41*

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:75px;"><col style="width:70px;"><col style="width:75px;"><col style="width:69px;"><col style="width:85px;"><col style="width:388px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

I want to work out the parking time in Col G if the next journey is on the same day or next day only for that car.

The car registration must be the same also. If the next journey is not on the same day or next day then leave it blank.

I though that it would be like this but it does not work

=IF(AND(A3=A4,OR(B3=B3,B3=B3+1)),f3,"")

Thanks

John
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try this:
=IF(AND(A3=A4,OR(B4=B3,B4=B3+1)),F3,"")
 
Upvote 0

Forum statistics

Threads
1,203,060
Messages
6,053,303
Members
444,650
Latest member
bookendinSA

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