Need Help with Logical Statements

DOCDIVA

New Member
Joined
Apr 16, 2016
Messages
3
Hello-
I have roughly 300,000 rows. One of the columns is AM or PM for 12 hour time period. I want to check that is the column says AM to replace with 0. If the column value says PM, I want 720 to be placed

The formula I have is =IF (Cell location = AM, 0, 720) but it keeps coming up with #NAME? . . . Please assist! I don't have much experience with logical functions so IF could be the wrong formula or I could have made a mistake

I did expand the dada using the text to column function but do not know how this would hurt this formula if does not have issues

PLESAE HELP!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hello & Welcome to the Forum,

If the cell literary has "AM" or "PM", try...

=IF(A1="AM",0,IF(A1="PM",720,""))
 
Upvote 0
Thank you so much, Jeff!!

Ford - I am comparing efficiency by breaking time into minutes. These are all DB records, so it's frustrating to work with
 
Upvote 0
Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75

So you could probably do what you want, working directly on the data itself
 
Upvote 0
If anyone can think of another solution, I have one more issue. I have dates in the format of (MM/DD/YYYY) and further columns with time broken out into minutes. I want to compare dates. Column A = Submitted Date, B= Submitted Time in minutes, C= Resolved Date, D= Resolved Time in Minutes, E= Day difference between Submitted and Resolved dates, F = number of minutes for amount of days in between . . . for instance:

12/01/2012 287 12/01/2012 287 0 0 -> Want this to return 0
12/01/2012 485 12/01/2012 501 0 0 -> Want this to return 16
12/05/2012 116 12/06/2012 220 1 1440 -> Want this to return 1542 (1440 for the full day, plus the 104 for the other part)
12/05/2012 100 12/06/2012 90 1 1440 -> Want this to return 1430 (1440 - 10 for the incomplete day)


Any ideas??
 
Upvote 0
column a = submitted date, b= submitted time in minutes, c= resolved date, d= resolved time in minutes, e= day difference between submitted and resolved dates, f = number of minutes for amount of days in between . . . For instance:
12/01/2012 287 12/01/2012 287 0 0 -> want this to return 0
12/01/2012 485 12/01/2012 501 0 0 -> want this to return 16
12/05/2012 116 12/06/2012 220 1 1440 -> want this to return 1542 [sic; should be 1544] [...]
12/05/2012 100 12/06/2012 90 1 1440 -> want this to return 1430

e2: =c2-a2
f2: =e2*1440+d2-b2
or
f2: =(c2-a2)*1440+d2-b2
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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