Solved How to look up a date from another tab based on a condition

February 20, 2017 at 14:23:13
Specs: Windows 7
Basically I want to pull the correct date that is associated with a job number from one tab into another.

Column H on tab A references the job number.
Row 3 on tab B contains the job numbers
Row 5 on tab B contains the dates
I want the returned date to show in column F on tab A

I need to match the job numbers to return the correct date.

I know that SUMIF should work, but it returns 1/0/1900. Is the sheet corrupt perhaps? Changing the formatting of the field doesn't do nothing.
I am stuck now.
Thanks a bunch!



See More: How to look up a date from another tab based on a condition

Report •

#1
February 20, 2017 at 14:53:55
✔ Best Answer
I'm not sure why you think SUMIF should work.

SUMIF is used to SUM the values in a range that meet criteria that you specify, as explained here:

https://support.office.com/en-us/ar...

In your case, it sounds like HLOOKUP is the proper function. Something like this should work:

=HLOOKUP(A!H5,B!$C$3:$I$5,3,0)

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
February 20, 2017 at 15:06:45
Because I tried it in another clean sheet and it worked.

Nonetheless, thank you so very much, your HLOOKUP function does work.


Report •

#3
February 20, 2017 at 15:26:44
Well, I guess SUMIF "works", but only because you are only "summing" a single cell.

HLOOKUP is certainly the better choice because it does what you are actually trying to do. I sure would be confused if I came along later and tried to figure out what you were doing if I saw SUMIF.

Will you always be looking up just one instance of a given job number? HLOOKUP will always return the first occurrence in the table_array, but there is a trick to extract the 2nd or 3rd, etc. occurrence of a given lookup_value.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •
Related Solutions


Ask Question