# Compare values in two different columns

1. ## Compare values in two different columns

Hello,

I need to compare values in 2 columns within a range of data in two other columns. (Note: first 2 columns must be locked so data in first column is next to the associated value in next column. This also applies to the 2 columns I am compare it to - Column A & B locked with each other as well as D & E locked with each other).

Desired outcome: Column C (Results) indicates"Missed visit" if values in A&B do not occur in D&E. "Good" if they occur.
Bonus: "Late" if date in Column E do not occur in same month.

Thanks for your help.

2. ## Re: Compare values in two different columns

Hi sunijayanna,

Try using below formula:-

=IF(ISERROR(VLOOKUP(A:A,D:E,2,0)=B2),"Missed visit",IF(VLOOKUP(A:A,D:E,2,0)=B2,"Good","Late"))

see attached:- Excel worksheet.xls

Regards,
DILIPandey

<click on below 'star' if this helps>

3. ## Re: Compare values in two different columns

Thanks DILIPandey! That worked great.

What part of the formula did it calculate that the visit did not occur in the same month?

4. ## Re: Compare values in two different columns

You are welcome suniljayanna,

IsError is checking if the visit happened or not.

Regards,
DILIPandey

<click on below 'star' if this helps>

5. ## Re: Compare values in two different columns

How would I set parameters if visit is outside a X number of days or in a different month?

Thanks

6. ## Re: Compare values in two different columns

Hi Suniljayanna,

This is what I was expecting

I have revised the formula to handle all three cases :-
Missed visit
Met as Projected
Late visit

See formula in blue if you want to consider month of visit and change that accordingly to suit your requirement

Excel worksheet.xls

Regards,
DILIPandey

<click on below 'star' if this helps>

7. ## Re: Compare values in two different columns

Perfect - thanks!

8. ## Re: Compare values in two different columns

you are welcome . .

cheers.

Regards,
DILIPandey

<click on below star if this helps>

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1