If specific text in cell A, then current time + other time in cell B

Olisthoughts

New Member
Joined
Apr 16, 2020
Messages
33
Office Version
  1. 365
Platform
  1. Windows
Hello,

We have a simple break list at work. I spent a lot of time making a better one, but the manager said it's too complicated.

I want to improve the one we have now at least a little. (screenshot attached)

In this break list, when you click on a cell under the "status" column - you have 4 selections available, like templates. (15 minute break / Lunch / short break) The problem is we have to manually calculate the time that we will return at.

As soon as I enter the text Lunch in status I want the next cell to calculate what time I will be back at.

I want to have a pseudo-formula like this "If cell A = "Lunch", then current time +time 30 minutes, else if cell A = "break 15 min", then current time + time 15 minute, else if cell A = "short break", then nothing/5-7 minutes (short break is flexible), else nothing"

This break list is uploaded in Microsoft Teams, so code/macro will probably not work. A formula is needed.

My only experience with formulas was when building the other break list and some functions to add I can take from what I learned then. But I don't how to make this one work.

Thank you.
 

Attachments

  • Screenshot_865.png
    Screenshot_865.png
    16 KB · Views: 11

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Unfortunately you cannot do that using formulae, unless you enable iterative calculation, which can cause problems.
 
Upvote 0
You would need to set iterative calculation for each user & that could adversely affect any other workbooks they use.
Also I'm not sure if you can do that when using Excel online.
 
Upvote 0
What about this clearly wrong formula, does this give you any idea that with your knowledge you could make it work? =IF(ISTEXT"Lunch",TIME(now))
 
Upvote 0
If you use the NOW() function, it will update every time any cell is changed, therefore will not work.
 
Upvote 0
I think I figured it out.

Instead of using just 1 column, I can have either 2 visible columns, or 1 helper hidden column, and another one.

One for current time in case the text matches: =IF(ISNUMBER(SEARCH("Lunch",A1)),NOW(),"")

And one to calculate the return time based on the current time: =IF(ISBLANK(B1),"",B1+TIME(0,30,0))

Can you please help me make this formula work with longer/multiple values using OR functions or something similar?

So it could include all breaks.
 

Attachments

  • Screenshot_866.png
    Screenshot_866.png
    6 KB · Views: 9
Upvote 0
I think there's a mistake there, but I'm gonna keep searching to see if I could find a way
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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