skrot
skrot

Reputation: 1

Matching columns of data and returning the value from a column with a value in Excel

Would need help on matching columns in Excel. I have a datasheet in the following order:

Column 1    Column 2    Column 3 
1.1.2015    -           1.1.2015
-           1.1.2013    1.1.2013
-           -           -

I have data in columns 1 and 2 and would like to lookup the data values from them in column 3. Hence if Column 1 takes on value 1.1.2015 but column 2 takes on value "-" there would be a function in column 3 that returns a value from column 1 when there is a value. And on the next row the same thing but the value that is looked up now is in column 2 as column 1 has a value of "-". I have a sheet of 15,000 rows so an individual function for each row is not possible. Additionally if both columns 1 & 2 have the value "-" the lookup function should result in a "-" in column 3. I have other variables in addition to dates as well and if there is an function that could handle both dates, numeric values and text values it would be really helpful.

Thanks for any help!

Upvotes: 0

Views: 94

Answers (1)

Forward Ed
Forward Ed

Reputation: 9874

try this in your third column and copy down

=if(A1<>"-",A1,B1)

basically if A1 has a value, use the value, otherwise enter whatever is in B1. Since B1 will either be a "-" or a value, you'll have all your cases covered.

I am confused why you say a "an individual function for each row is not possible" When you copy and paste the cell C1 to cells C2 to C15000 the formula automatically updates.

Upvotes: 1

Related Questions