Need a hand writing a formula

N

Niels Jensen

Hi, I'm making up a spreadsheet where it tells me how many on call shifts I've done. The issue I currently have is that there are a group of 7 dates in a column which count as double shifts. What i'd like to do it compare the dates in these cells to the dates in another column and if one of them matches, then I'd like to make the value of a different cell "2"

I figure a huge if statement would do it but there must be a simpler way..

Any help would be appreciated
 
D

DNF Karran

I'm having a blank moment-

=IF(ISNA(MATCH(A1,$D$1:$D$3,0)),0,2)

is my suggestion though I'm sure there's a better way....

A1 is the date to compare, D1:D3 is the range of dates and if i
doesn't match you get the error "#N/A". This is then picked up and use
in the IF statement.

You can then drag the match function so it checks all of your date
against the range.

Dunca
 
Top