need formula calculating time from the work sent

zoharb

Board Regular
Joined
Nov 24, 2011
Messages
73
Office Version
  1. 2021
  2. 2013
Respected,
The user will insert current date & time in COL B using ctrl+: and ctrl+shift+:
The formula (in Col J) is calculating whether it is pending or not based on input given in COL G H I
We want to calculate time upto nearest hour based on date+time stamp added in COL B(I have used today() but other function can be used)
Zohar Batterywala
 

Attachments

  • Screenshot 2024-11-28 033314-2.png
    Screenshot 2024-11-28 033314-2.png
    99.8 KB · Views: 3
  • Screenshot 2024-11-28 033314-3.png
    Screenshot 2024-11-28 033314-3.png
    100.8 KB · Views: 3

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
formula used in calculation in COL J
=IF(AND(G2="digitizing",H2=""),"pending-"&(TODAY()-B2)*24&"hr",(IF(AND(G2="artwork",I2=""),"pending"&(TODAY()-B2)*24&"hr","")))
 
Upvote 0
See if this gets you any closer. You indicated you always want to round UP.
Note:
• You are not displaying the Time in column B. This means that your hour calculation won't have any context and will be hard to understand
• If you are going down to the hour then should you be using Now() instead of Today()
• I would not put Today or Now in the formula. It means it is constantly changing and you can't view it at a particular point in time should you need to do so.
Put the Now() or Today() in a cell and refer to it. This will also help when you are testing.

Excel Formula:
=IF(OR(
       AND(G2="digitizing",H2=""),
       AND(G2="artwork",I2="")),
    "pending-"&TEXT(ROUNDUP((TODAY()-B2)*24,0),"##0")&" hrs",
    "")
 
Upvote 0
Hi Alex,
ISSUE is solved.
formula used --- =IF(AND(G2065="digitizing",H2065=""),"pending-"&ROUND((NOW()-B2065)*24,2)&"hr",(IF(AND(G2065="artwork",I2065=""),"pending"&ROUND((NOW()-B2065)*24,2)&"hr","")))
THANK YOU anyway for guiding me
HAPPY THANKSGIVING
 

Attachments

  • pending formula issue@25nov24-1811.jpg
    pending formula issue@25nov24-1811.jpg
    34.4 KB · Views: 2
Upvote 0
Solution
You're welcome. Glad you found something that worked for you.
I would still suggest you would be better off following my approach, it requires less maintenance. You have currently got what should be an identical output in 2 places and in one you just have "pending" and the other you have "pending-". This will only get worse if you add more conditions.
I did think about using the LET function to save repeating the text but you have both versions 2021 & 2013 listed and LET would only work in 2021.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

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