Formula or macro to delete spec. cell if one cell contains exact text

jodepp000

New Member
Joined
Jul 27, 2023
Messages
1
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. Web
Hi, I was doing some time tables for the work, and now I have a problem with 3 specific cases.
it's a regular table where you need to input coming and leaving times, everything else should be calculated automatically (pause times, overall working times, etc.).
The problem is that if you are away, you'll need to select "GZ" from drop-down list and the cell become #VALUE! cause there are no input-times (wrong.png)
As said before, it needs to be done automatically, so it should look like this (good.png).
So the theory was: if B5 contains "GZ", than delete contents of cells E5 to J5, and to put "-8,00" into L5

I have done it with If-loop, but I need 3 different situations (GZ, KR, U) and for any situation in L5 should be another numer...which can't work with only IF.

Do you have some suggestions?
 

Attachments

  • wrong.png
    wrong.png
    4.7 KB · Views: 12
  • good.png
    good.png
    4.1 KB · Views: 13

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,215,086
Messages
6,123,035
Members
449,092
Latest member
ikke

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