Return value of blank cells in a row

Lauren_M

New Member
Joined
Dec 20, 2011
Messages
16
Hey everyone,

Since you were all so helpful yesterday, I thought I'd come back again today and see if you are able to assist with my next issue.
I have exported a customer database from our system and each of our customers have certain "roles" applied to them depending on what they have purchased. Some customers might have 3 roles and other customers may have 10 roles. They all export in the one cell and the roles are seperated by a ;
I use a text to column function to get each of the role into it's own row, I then use a filter function and clear the contents of the cells I don't require for this particular report.
So I am left with over 3,000 customers and their role could be anywhere in row 1 through to row 10 and I need to get them all into the one row so that I can remove roles that have expired.

So I was hoping there might be a formula to return the first non-blank value in a row range.

Perhaps I am tackling this the whole wrong way and am totally open to any suggestions.

Hopefully I have provided enough information, please let me know if I have not.

As always, I appreciate all answers/advice/help.

Regards,

Lauren
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Excel 2010
ABCDEFGHIJ
1RedRed
2OrangeOrange
3YellowYellow
4GreenGreen
5BlueBlue
6IndigoIndigo
7VioletViolet
8SilverSilver
9WhiteWhite
10ClearClear
Sheet5
Cell Formulas
RangeFormula
A1=INDEX(B1:K1,SUMPRODUCT(--(B1:K1<>""),COLUMN(B1:K1))-1)
 
Upvote 0
Thanks a bunch! This returns a "0" value in my spread sheet, however when I replicated yours above it worked! So very strange and I have to keep playing around with mine...
 
Upvote 0
I've worked out why, it's because there is multiple values in row. There is the role, then the start date and the finish date. I added another colour into your spread sheet and it returned the "0" value.
So I deleted the start date and end date, but it still doesn't work.
Do I need to use the "if" statement since I have more than one cell with data in a row?
 
Upvote 0
Try:


Excel 2010
ABCDEFGHIJ
1RedRedMaroon
2GrayGrayOrange
3YellowYellow
4GreenGreen
5BlueBlue
6IndigoIndigo
7TurquoiseTurquoiseViolet
8SilverSilver
9WhiteWhite
10ClearClear
Sheet5
Cell Formulas
RangeFormula
A1=INDEX(B1:K1,MATCH(TRUE,INDEX((B1:K1<>0),0),0))
 
Upvote 0
That worked!!!!! yay :) Thanks a bunch! Now if I wanted to return the second value in that row I have tried changing the last 0 to -1, is that right? Or is there a different way?
 
Upvote 0

Excel 2010
ABCDEFGHIJ
1MaroonRedMaroon
2OrangeGrayOrange
3YellowBBBYellow
4TTTGreenTTT
5RRRBlueRRR
6JJJIndigoJJJ
7VioletTurquoiseViolet
8SilverSSSSilver
9QQQWhiteQQQ
10VVVClearVVV
Sheet5
Cell Formulas
RangeFormula
A1{=INDEX(B1:K1,SMALL(IF(ISBLANK(B1:K1),"",COLUMN(B1:K1)),2)-COLUMN(B1:K1)+1)}
Press CTRL+SHIFT+ENTER to enter array formulas.



Change the 2 to a 3, etc. It will return an error if there are fewer than n nonblank cells.
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,795
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top