if statement

rduke

Board Regular
Joined
Nov 27, 2002
Messages
53
I have a spreadsheet that records the date of when an event happens. I have another spreadsheet that I want to count when an event happens in the month of April.

I tried this and it gives me a result of 1 even if the the event happen before the month in question.

=IF('[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>31/3/2011,1,0)

This formula returns a valve of 1 even if the cell that contains the information is not greater than the date in the formula.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi,

You need to put the date in speech marks ( " " ), otherwise you are doing 31 divided by 3, divided by 2011, which is 0.00513840543676446!

So:

=IF('[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>"31/3/2011",1,0)
 
Upvote 0
I have a spreadsheet that records the date of when an event happens. I have another spreadsheet that I want to count when an event happens in the month of April.

I tried this and it gives me a result of 1 even if the the event happen before the month in question.

=IF('[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>31/3/2011,1,0)

This formula returns a valve of 1 even if the cell that contains the information is not greater than the date in the formula.
Use a cell to hold the date criteria:
  • A1 = 31/3/2011
Then refer to that cell like this:

=IF('[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>A1,1,0)

Or, more simply:

=--('[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>A1)
 
Upvote 0
As in the date is in a cell?

In which case:

=IF('[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>B1,1,0)

Where B1 is your date.
 
Upvote 0
I have a spreadsheet that records the date of when an event happens. I have another spreadsheet that I want to count when an event happens in the month of April.

I tried this and it gives me a result of 1 even if the the event happen before the month in question.

=IF('[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>31/3/2011,1,0)

This formula returns a valve of 1 even if the cell that contains the information is not greater than the date in the formula.


maybe try
=IF('[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>DATE(2011,03,31),1,0)
 
Upvote 0
The value =cell Delivery Redelivery Databse HGN.xls]DEL'!$I1083 is 01/04/2011 9:36:00 PM

The value =cell A3 is 31/03/2011 11:59:00 PM

The value =cell A4 is 01/04/2011

=IF(AND('S:\Vessel Database\[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>$A$3,'S:\Vessel Database\[Delivery Redelivery Databse HGN.xls]DEL'!$I1083<$A$4), 1, 0)

The value returned is 0, it should be 1

help please
 
Upvote 0
The value =cell Delivery Redelivery Databse HGN.xls]DEL'!$I1083 is 01/04/2011 9:36:00 PM

The value =cell A3 is 31/03/2011 11:59:00 PM

The value =cell A4 is 01/04/2011

=IF(AND('S:\Vessel Database\[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>$A$3,'S:\Vessel Database\[Delivery Redelivery Databse HGN.xls]DEL'!$I1083<$A$4), 1, 0)

The value returned is 0, it should be 1

help please
Try it like this...

=--AND('S:\Vessel Database\[Delivery Redelivery Databse HGN.xls]DEL'!$I1083>$A$3,INT('S:\Vessel Database\[Delivery Redelivery Databse HGN.xls]DEL'!$I1083)<=$A$4)
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,445
Members
452,915
Latest member
hannnahheileen

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