ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formulae trouble (https://www.excelbanter.com/excel-programming/388371-formulae-trouble.html)

Sheena

Formulae trouble
 
Hi,

I need to create a forumulae which checks data against the appropraite rows.

For example:

They need to search the worksheet for the corresponding row and then check
the date from that row against the current cell and output if the date is
earlier or later. I tried using an IF statement where I compared the cells
against each other but this didn't work.

I thought that something like a FOR or WHERE statement would be better but I
cannot work out how to create one in excel. It would have to probably read
something like:

WHERE column a = column b
IF date 1 date 2
earlier
ELSE
later

Sorry if this doesn't make sense I'm not sure how to phrase it.

Thanks.

JLatham

Formulae trouble
 
Are these two columns on the same sheet, or on different sheets in the book?
I think maybe we need a little more detailed explanation of how your sheet(s)
are set up and what determine just what the 'corresponding row' is?

I presume, but I'm not sure, from your "WHERE column a = column b" clause
that that we're dealing with information on just one worksheet?


If we are doing tests on individual rows on a single sheet, something like
this should work:
columns D and F contain the 2 items to compare for equality (WHERE....)
column E has date 1, column G has date 2. There are 3 possible conditions
for the dates: Earlier, Later, or on same date.
=IF(D4=F4,IF(E4G4,"Earlier",IF(E4<G4,"Later","Sam e Date")),"")

If I've missed the target, definitely explain more about your sheet/workbook
setup.

"Sheena" wrote:

Hi,

I need to create a forumulae which checks data against the appropraite rows.

For example:

They need to search the worksheet for the corresponding row and then check
the date from that row against the current cell and output if the date is
earlier or later. I tried using an IF statement where I compared the cells
against each other but this didn't work.

I thought that something like a FOR or WHERE statement would be better but I
cannot work out how to create one in excel. It would have to probably read
something like:

WHERE column a = column b
IF date 1 date 2
earlier
ELSE
later

Sorry if this doesn't make sense I'm not sure how to phrase it.

Thanks.



All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com