Link to home
Start Free TrialLog in
Avatar of wlwebb
wlwebbFlag for United States of America

asked on

Excel function to return a row's column number that has data

Hello Experts
Thanks as always in advance for your help.

I have a file that gets created from an export from a program.  The way the export program sends the data out causes the data for a particular row to either be in column A, B or C (it varies).   One row the data will be in A, the next in B the next back to A, the next to C etc..   Each row has only one column's cell that will have data.  

I have looked for a function that would look at columns A:C find which column of the particular row had data and get that data.  Essentially pulling all the data in to One Column for all rows.

I've looked at Hlookup; Index etc.. but can not get anything to work.  Probably because I'm writing the code wrong.
SOLUTION
Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wlwebb

ASKER

Good lord that was simple.  So let me through a curveball to that.  Lets say A, B and C can each contain data within a row and I want to test for the right most column that has data and get the column number that has.

Example:

Lets say Row - {Column A}/{Column B}/{Column C} - I'll use **** to indicate blank
1 - *** / 123 / 123
2 - 123 / 123 / ***
3 - 123 / *** / 123
4 - 123 / ***/ ***
5 - *** / 123 / 123

Then the result I would want is:
1 - C
2 - B
3 - C
4 - A
5 - C

Is there a function/set of functions that could test for that?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wlwebb

ASKER

Perfect,  Thanks