Find first non-blank cell in a range
I am working with a list of data where one or multiple cells in a row can be blank.
Lets say the list is cells A1
, A2
, A3
, A4
. I am trying to create a function that will do the following:
IF A1 has a value I want the cell to return A1.
IF A1 is empty then I want it to return A2.
IF A1 and A2 are both empty I want it to return A3.
If A1, A2 and A3 are all empty I want it to return A4.
excel
add a comment |
I am working with a list of data where one or multiple cells in a row can be blank.
Lets say the list is cells A1
, A2
, A3
, A4
. I am trying to create a function that will do the following:
IF A1 has a value I want the cell to return A1.
IF A1 is empty then I want it to return A2.
IF A1 and A2 are both empty I want it to return A3.
If A1, A2 and A3 are all empty I want it to return A4.
excel
1
how many rows do you need to support, if it's few you can do nested if statements=IF(A1<>"",A1,IF(A2<>"",A2,IF(A3<>"",IF(A4<>"",""))))
would handle your example
– Vincent De Smet
Apr 30 '15 at 12:13
I am working with financial data so the list is about 500 rows. the issue is certain dates will have blanks and I am trying to fill the blanks in with prior data. there are about 100 lists and each list will have different different dates missing. I had thought about the if blank function as there should never be more than 4 consecutive dates missing but couldn't figure out how to do it. this seems like a great solution thank you so much
– excelquestion
Apr 30 '15 at 14:39
in this case, your example & explanation did not really match your requirements. There might be a better approach to your issue. also, I made a mistake at the A3 part, there should beA3,
between,
andIF(A4...
– Vincent De Smet
Apr 30 '15 at 14:41
I added another answer based on your comment, sorry for changing your title as your description seemed different from what you needed. I don't think this can easily be done with a formula, the vba required to achieve what you need is quite short. have a look and have fun!
– Vincent De Smet
Apr 30 '15 at 14:56
can't excel just add a =COALESCE() function like in SQL ?
– Rutger Hofste
Sep 3 '18 at 14:50
add a comment |
I am working with a list of data where one or multiple cells in a row can be blank.
Lets say the list is cells A1
, A2
, A3
, A4
. I am trying to create a function that will do the following:
IF A1 has a value I want the cell to return A1.
IF A1 is empty then I want it to return A2.
IF A1 and A2 are both empty I want it to return A3.
If A1, A2 and A3 are all empty I want it to return A4.
excel
I am working with a list of data where one or multiple cells in a row can be blank.
Lets say the list is cells A1
, A2
, A3
, A4
. I am trying to create a function that will do the following:
IF A1 has a value I want the cell to return A1.
IF A1 is empty then I want it to return A2.
IF A1 and A2 are both empty I want it to return A3.
If A1, A2 and A3 are all empty I want it to return A4.
excel
excel
edited Apr 30 '15 at 12:54
Vincent De Smet
3,65312536
3,65312536
asked Apr 30 '15 at 12:09
excelquestionexcelquestion
71113
71113
1
how many rows do you need to support, if it's few you can do nested if statements=IF(A1<>"",A1,IF(A2<>"",A2,IF(A3<>"",IF(A4<>"",""))))
would handle your example
– Vincent De Smet
Apr 30 '15 at 12:13
I am working with financial data so the list is about 500 rows. the issue is certain dates will have blanks and I am trying to fill the blanks in with prior data. there are about 100 lists and each list will have different different dates missing. I had thought about the if blank function as there should never be more than 4 consecutive dates missing but couldn't figure out how to do it. this seems like a great solution thank you so much
– excelquestion
Apr 30 '15 at 14:39
in this case, your example & explanation did not really match your requirements. There might be a better approach to your issue. also, I made a mistake at the A3 part, there should beA3,
between,
andIF(A4...
– Vincent De Smet
Apr 30 '15 at 14:41
I added another answer based on your comment, sorry for changing your title as your description seemed different from what you needed. I don't think this can easily be done with a formula, the vba required to achieve what you need is quite short. have a look and have fun!
– Vincent De Smet
Apr 30 '15 at 14:56
can't excel just add a =COALESCE() function like in SQL ?
– Rutger Hofste
Sep 3 '18 at 14:50
add a comment |
1
how many rows do you need to support, if it's few you can do nested if statements=IF(A1<>"",A1,IF(A2<>"",A2,IF(A3<>"",IF(A4<>"",""))))
would handle your example
– Vincent De Smet
Apr 30 '15 at 12:13
I am working with financial data so the list is about 500 rows. the issue is certain dates will have blanks and I am trying to fill the blanks in with prior data. there are about 100 lists and each list will have different different dates missing. I had thought about the if blank function as there should never be more than 4 consecutive dates missing but couldn't figure out how to do it. this seems like a great solution thank you so much
– excelquestion
Apr 30 '15 at 14:39
in this case, your example & explanation did not really match your requirements. There might be a better approach to your issue. also, I made a mistake at the A3 part, there should beA3,
between,
andIF(A4...
– Vincent De Smet
Apr 30 '15 at 14:41
I added another answer based on your comment, sorry for changing your title as your description seemed different from what you needed. I don't think this can easily be done with a formula, the vba required to achieve what you need is quite short. have a look and have fun!
– Vincent De Smet
Apr 30 '15 at 14:56
can't excel just add a =COALESCE() function like in SQL ?
– Rutger Hofste
Sep 3 '18 at 14:50
1
1
how many rows do you need to support, if it's few you can do nested if statements
=IF(A1<>"",A1,IF(A2<>"",A2,IF(A3<>"",IF(A4<>"",""))))
would handle your example– Vincent De Smet
Apr 30 '15 at 12:13
how many rows do you need to support, if it's few you can do nested if statements
=IF(A1<>"",A1,IF(A2<>"",A2,IF(A3<>"",IF(A4<>"",""))))
would handle your example– Vincent De Smet
Apr 30 '15 at 12:13
I am working with financial data so the list is about 500 rows. the issue is certain dates will have blanks and I am trying to fill the blanks in with prior data. there are about 100 lists and each list will have different different dates missing. I had thought about the if blank function as there should never be more than 4 consecutive dates missing but couldn't figure out how to do it. this seems like a great solution thank you so much
– excelquestion
Apr 30 '15 at 14:39
I am working with financial data so the list is about 500 rows. the issue is certain dates will have blanks and I am trying to fill the blanks in with prior data. there are about 100 lists and each list will have different different dates missing. I had thought about the if blank function as there should never be more than 4 consecutive dates missing but couldn't figure out how to do it. this seems like a great solution thank you so much
– excelquestion
Apr 30 '15 at 14:39
in this case, your example & explanation did not really match your requirements. There might be a better approach to your issue. also, I made a mistake at the A3 part, there should be
A3,
between ,
and IF(A4...
– Vincent De Smet
Apr 30 '15 at 14:41
in this case, your example & explanation did not really match your requirements. There might be a better approach to your issue. also, I made a mistake at the A3 part, there should be
A3,
between ,
and IF(A4...
– Vincent De Smet
Apr 30 '15 at 14:41
I added another answer based on your comment, sorry for changing your title as your description seemed different from what you needed. I don't think this can easily be done with a formula, the vba required to achieve what you need is quite short. have a look and have fun!
– Vincent De Smet
Apr 30 '15 at 14:56
I added another answer based on your comment, sorry for changing your title as your description seemed different from what you needed. I don't think this can easily be done with a formula, the vba required to achieve what you need is quite short. have a look and have fun!
– Vincent De Smet
Apr 30 '15 at 14:56
can't excel just add a =COALESCE() function like in SQL ?
– Rutger Hofste
Sep 3 '18 at 14:50
can't excel just add a =COALESCE() function like in SQL ?
– Rutger Hofste
Sep 3 '18 at 14:50
add a comment |
5 Answers
5
active
oldest
votes
first result on google: http://chandoo.org/wp/2014/01/15/find-first-non-blank-item-in-a-list-excel-formulas/
This formula returns the first TEXT cell for a range
B1:B100
:
=VLOOKUP("*", B1:B100, 1,FALSE)
* is a wild card in Excel. When you ask VLOOKUP to find *, it finds the first cell that contains anything.
NOTE: This approach finds first cell that contains any TEXT. So if the first non-blank cell is a number (or date, % or Boolean value), the formula shows next cell that contains text.
If you need to find non-blank that url gives the following solution:
If you want to find first non-blank value, whether it is text or number, then you can use below array formula.
=INDEX(B3:B100, MATCH(FALSE, ISBLANK(B1:B100), 0))
Make sure you press CTRL+Shift+Enter after typing this formula.
How this formula works?
ISBLANK(B1:B100)
portion: This gives us list ofTRUE
/FALSE
values depending on the 98 cells inB1:B100
are blank or not. It looks like this:
{TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE; ...}
MATCH(FALSE, ISBLANK(…), 0)
portion: Once we have theTRUE
/FALSE
values, we just need to find the firstFALSE
value (ie, first non-blank cell). That is what thisMATCH
function does. It finds an exact match of FALSE value in the list.
INDEX(B1:B100, MATCH(…))
portion: Once we know which cell is the first non-blank cell, we need its value. That is whatINDEX
does.
add a comment |
As indicated in your comment on your question, you have 500 rows interspersed with blank cells. You want to fill blank cells with the value of the last non blank cell.
I'd write some VBA code that'd work as follows: select the range of cells you want to back fill and run this VBA:
Sub fillBlanks()
For Each c In Selection.Cells
If c.Value <> "" Then
lastVal = c.Value
Else
c.Value = lastVal
End If
Next c
End Sub
basically, if the cell is empty, use the value of the last non blank cell (if there were no blank cells above, it will remain blank). Else, if the cell is not empty, save this as the last non blank cell. Repeat for every cell in the selected range.
Step by Step instructions on using this vba code - for this sample worksheet:
Make sure the range is selected, press ALT+F11.
This should open the Visual Basic Editor:
Press F7, This should bring up the code for the activesheet. Paste the VB code from above:
Press F5 (or use the menu to run the code).
The end result should be as follows:
add a comment |
You can just put a rank.eq
formula in the column next to it, and do a vlookup
to bring all of your data to the top. This will bring all of your data to the top.
For example, in the image below I am ranking using the percentage, I want to bring the cells with data to the top for presentation, I will hide all columns other than where my vlookups
are.
add a comment |
This did the trick for me
=LOOKUP(2,1/(A1:A13<>""),A1:A13)
Source credit: here
add a comment |
Select ColumnA:
HOME > Editing > Find & Select > Go To Special... > Blanks, OK, =, ↓, Ctrl+Enter.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29967410%2ffind-first-non-blank-cell-in-a-range%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
first result on google: http://chandoo.org/wp/2014/01/15/find-first-non-blank-item-in-a-list-excel-formulas/
This formula returns the first TEXT cell for a range
B1:B100
:
=VLOOKUP("*", B1:B100, 1,FALSE)
* is a wild card in Excel. When you ask VLOOKUP to find *, it finds the first cell that contains anything.
NOTE: This approach finds first cell that contains any TEXT. So if the first non-blank cell is a number (or date, % or Boolean value), the formula shows next cell that contains text.
If you need to find non-blank that url gives the following solution:
If you want to find first non-blank value, whether it is text or number, then you can use below array formula.
=INDEX(B3:B100, MATCH(FALSE, ISBLANK(B1:B100), 0))
Make sure you press CTRL+Shift+Enter after typing this formula.
How this formula works?
ISBLANK(B1:B100)
portion: This gives us list ofTRUE
/FALSE
values depending on the 98 cells inB1:B100
are blank or not. It looks like this:
{TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE; ...}
MATCH(FALSE, ISBLANK(…), 0)
portion: Once we have theTRUE
/FALSE
values, we just need to find the firstFALSE
value (ie, first non-blank cell). That is what thisMATCH
function does. It finds an exact match of FALSE value in the list.
INDEX(B1:B100, MATCH(…))
portion: Once we know which cell is the first non-blank cell, we need its value. That is whatINDEX
does.
add a comment |
first result on google: http://chandoo.org/wp/2014/01/15/find-first-non-blank-item-in-a-list-excel-formulas/
This formula returns the first TEXT cell for a range
B1:B100
:
=VLOOKUP("*", B1:B100, 1,FALSE)
* is a wild card in Excel. When you ask VLOOKUP to find *, it finds the first cell that contains anything.
NOTE: This approach finds first cell that contains any TEXT. So if the first non-blank cell is a number (or date, % or Boolean value), the formula shows next cell that contains text.
If you need to find non-blank that url gives the following solution:
If you want to find first non-blank value, whether it is text or number, then you can use below array formula.
=INDEX(B3:B100, MATCH(FALSE, ISBLANK(B1:B100), 0))
Make sure you press CTRL+Shift+Enter after typing this formula.
How this formula works?
ISBLANK(B1:B100)
portion: This gives us list ofTRUE
/FALSE
values depending on the 98 cells inB1:B100
are blank or not. It looks like this:
{TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE; ...}
MATCH(FALSE, ISBLANK(…), 0)
portion: Once we have theTRUE
/FALSE
values, we just need to find the firstFALSE
value (ie, first non-blank cell). That is what thisMATCH
function does. It finds an exact match of FALSE value in the list.
INDEX(B1:B100, MATCH(…))
portion: Once we know which cell is the first non-blank cell, we need its value. That is whatINDEX
does.
add a comment |
first result on google: http://chandoo.org/wp/2014/01/15/find-first-non-blank-item-in-a-list-excel-formulas/
This formula returns the first TEXT cell for a range
B1:B100
:
=VLOOKUP("*", B1:B100, 1,FALSE)
* is a wild card in Excel. When you ask VLOOKUP to find *, it finds the first cell that contains anything.
NOTE: This approach finds first cell that contains any TEXT. So if the first non-blank cell is a number (or date, % or Boolean value), the formula shows next cell that contains text.
If you need to find non-blank that url gives the following solution:
If you want to find first non-blank value, whether it is text or number, then you can use below array formula.
=INDEX(B3:B100, MATCH(FALSE, ISBLANK(B1:B100), 0))
Make sure you press CTRL+Shift+Enter after typing this formula.
How this formula works?
ISBLANK(B1:B100)
portion: This gives us list ofTRUE
/FALSE
values depending on the 98 cells inB1:B100
are blank or not. It looks like this:
{TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE; ...}
MATCH(FALSE, ISBLANK(…), 0)
portion: Once we have theTRUE
/FALSE
values, we just need to find the firstFALSE
value (ie, first non-blank cell). That is what thisMATCH
function does. It finds an exact match of FALSE value in the list.
INDEX(B1:B100, MATCH(…))
portion: Once we know which cell is the first non-blank cell, we need its value. That is whatINDEX
does.
first result on google: http://chandoo.org/wp/2014/01/15/find-first-non-blank-item-in-a-list-excel-formulas/
This formula returns the first TEXT cell for a range
B1:B100
:
=VLOOKUP("*", B1:B100, 1,FALSE)
* is a wild card in Excel. When you ask VLOOKUP to find *, it finds the first cell that contains anything.
NOTE: This approach finds first cell that contains any TEXT. So if the first non-blank cell is a number (or date, % or Boolean value), the formula shows next cell that contains text.
If you need to find non-blank that url gives the following solution:
If you want to find first non-blank value, whether it is text or number, then you can use below array formula.
=INDEX(B3:B100, MATCH(FALSE, ISBLANK(B1:B100), 0))
Make sure you press CTRL+Shift+Enter after typing this formula.
How this formula works?
ISBLANK(B1:B100)
portion: This gives us list ofTRUE
/FALSE
values depending on the 98 cells inB1:B100
are blank or not. It looks like this:
{TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE; ...}
MATCH(FALSE, ISBLANK(…), 0)
portion: Once we have theTRUE
/FALSE
values, we just need to find the firstFALSE
value (ie, first non-blank cell). That is what thisMATCH
function does. It finds an exact match of FALSE value in the list.
INDEX(B1:B100, MATCH(…))
portion: Once we know which cell is the first non-blank cell, we need its value. That is whatINDEX
does.
edited Apr 30 '15 at 12:26
answered Apr 30 '15 at 12:16
Vincent De SmetVincent De Smet
3,65312536
3,65312536
add a comment |
add a comment |
As indicated in your comment on your question, you have 500 rows interspersed with blank cells. You want to fill blank cells with the value of the last non blank cell.
I'd write some VBA code that'd work as follows: select the range of cells you want to back fill and run this VBA:
Sub fillBlanks()
For Each c In Selection.Cells
If c.Value <> "" Then
lastVal = c.Value
Else
c.Value = lastVal
End If
Next c
End Sub
basically, if the cell is empty, use the value of the last non blank cell (if there were no blank cells above, it will remain blank). Else, if the cell is not empty, save this as the last non blank cell. Repeat for every cell in the selected range.
Step by Step instructions on using this vba code - for this sample worksheet:
Make sure the range is selected, press ALT+F11.
This should open the Visual Basic Editor:
Press F7, This should bring up the code for the activesheet. Paste the VB code from above:
Press F5 (or use the menu to run the code).
The end result should be as follows:
add a comment |
As indicated in your comment on your question, you have 500 rows interspersed with blank cells. You want to fill blank cells with the value of the last non blank cell.
I'd write some VBA code that'd work as follows: select the range of cells you want to back fill and run this VBA:
Sub fillBlanks()
For Each c In Selection.Cells
If c.Value <> "" Then
lastVal = c.Value
Else
c.Value = lastVal
End If
Next c
End Sub
basically, if the cell is empty, use the value of the last non blank cell (if there were no blank cells above, it will remain blank). Else, if the cell is not empty, save this as the last non blank cell. Repeat for every cell in the selected range.
Step by Step instructions on using this vba code - for this sample worksheet:
Make sure the range is selected, press ALT+F11.
This should open the Visual Basic Editor:
Press F7, This should bring up the code for the activesheet. Paste the VB code from above:
Press F5 (or use the menu to run the code).
The end result should be as follows:
add a comment |
As indicated in your comment on your question, you have 500 rows interspersed with blank cells. You want to fill blank cells with the value of the last non blank cell.
I'd write some VBA code that'd work as follows: select the range of cells you want to back fill and run this VBA:
Sub fillBlanks()
For Each c In Selection.Cells
If c.Value <> "" Then
lastVal = c.Value
Else
c.Value = lastVal
End If
Next c
End Sub
basically, if the cell is empty, use the value of the last non blank cell (if there were no blank cells above, it will remain blank). Else, if the cell is not empty, save this as the last non blank cell. Repeat for every cell in the selected range.
Step by Step instructions on using this vba code - for this sample worksheet:
Make sure the range is selected, press ALT+F11.
This should open the Visual Basic Editor:
Press F7, This should bring up the code for the activesheet. Paste the VB code from above:
Press F5 (or use the menu to run the code).
The end result should be as follows:
As indicated in your comment on your question, you have 500 rows interspersed with blank cells. You want to fill blank cells with the value of the last non blank cell.
I'd write some VBA code that'd work as follows: select the range of cells you want to back fill and run this VBA:
Sub fillBlanks()
For Each c In Selection.Cells
If c.Value <> "" Then
lastVal = c.Value
Else
c.Value = lastVal
End If
Next c
End Sub
basically, if the cell is empty, use the value of the last non blank cell (if there were no blank cells above, it will remain blank). Else, if the cell is not empty, save this as the last non blank cell. Repeat for every cell in the selected range.
Step by Step instructions on using this vba code - for this sample worksheet:
Make sure the range is selected, press ALT+F11.
This should open the Visual Basic Editor:
Press F7, This should bring up the code for the activesheet. Paste the VB code from above:
Press F5 (or use the menu to run the code).
The end result should be as follows:
edited Apr 30 '15 at 15:00
answered Apr 30 '15 at 14:54
Vincent De SmetVincent De Smet
3,65312536
3,65312536
add a comment |
add a comment |
You can just put a rank.eq
formula in the column next to it, and do a vlookup
to bring all of your data to the top. This will bring all of your data to the top.
For example, in the image below I am ranking using the percentage, I want to bring the cells with data to the top for presentation, I will hide all columns other than where my vlookups
are.
add a comment |
You can just put a rank.eq
formula in the column next to it, and do a vlookup
to bring all of your data to the top. This will bring all of your data to the top.
For example, in the image below I am ranking using the percentage, I want to bring the cells with data to the top for presentation, I will hide all columns other than where my vlookups
are.
add a comment |
You can just put a rank.eq
formula in the column next to it, and do a vlookup
to bring all of your data to the top. This will bring all of your data to the top.
For example, in the image below I am ranking using the percentage, I want to bring the cells with data to the top for presentation, I will hide all columns other than where my vlookups
are.
You can just put a rank.eq
formula in the column next to it, and do a vlookup
to bring all of your data to the top. This will bring all of your data to the top.
For example, in the image below I am ranking using the percentage, I want to bring the cells with data to the top for presentation, I will hide all columns other than where my vlookups
are.
edited Jul 1 '17 at 19:33
Greenonline
1,01221524
1,01221524
answered Jun 30 '17 at 19:14
KevinKevin
111
111
add a comment |
add a comment |
This did the trick for me
=LOOKUP(2,1/(A1:A13<>""),A1:A13)
Source credit: here
add a comment |
This did the trick for me
=LOOKUP(2,1/(A1:A13<>""),A1:A13)
Source credit: here
add a comment |
This did the trick for me
=LOOKUP(2,1/(A1:A13<>""),A1:A13)
Source credit: here
This did the trick for me
=LOOKUP(2,1/(A1:A13<>""),A1:A13)
Source credit: here
answered Aug 22 '18 at 11:25
jetpackdata.comjetpackdata.com
5,54834048
5,54834048
add a comment |
add a comment |
Select ColumnA:
HOME > Editing > Find & Select > Go To Special... > Blanks, OK, =, ↓, Ctrl+Enter.
add a comment |
Select ColumnA:
HOME > Editing > Find & Select > Go To Special... > Blanks, OK, =, ↓, Ctrl+Enter.
add a comment |
Select ColumnA:
HOME > Editing > Find & Select > Go To Special... > Blanks, OK, =, ↓, Ctrl+Enter.
Select ColumnA:
HOME > Editing > Find & Select > Go To Special... > Blanks, OK, =, ↓, Ctrl+Enter.
edited Jan 2 at 0:50
answered Jan 1 at 21:15
pnutspnuts
48.7k76299
48.7k76299
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29967410%2ffind-first-non-blank-cell-in-a-range%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
how many rows do you need to support, if it's few you can do nested if statements
=IF(A1<>"",A1,IF(A2<>"",A2,IF(A3<>"",IF(A4<>"",""))))
would handle your example– Vincent De Smet
Apr 30 '15 at 12:13
I am working with financial data so the list is about 500 rows. the issue is certain dates will have blanks and I am trying to fill the blanks in with prior data. there are about 100 lists and each list will have different different dates missing. I had thought about the if blank function as there should never be more than 4 consecutive dates missing but couldn't figure out how to do it. this seems like a great solution thank you so much
– excelquestion
Apr 30 '15 at 14:39
in this case, your example & explanation did not really match your requirements. There might be a better approach to your issue. also, I made a mistake at the A3 part, there should be
A3,
between,
andIF(A4...
– Vincent De Smet
Apr 30 '15 at 14:41
I added another answer based on your comment, sorry for changing your title as your description seemed different from what you needed. I don't think this can easily be done with a formula, the vba required to achieve what you need is quite short. have a look and have fun!
– Vincent De Smet
Apr 30 '15 at 14:56
can't excel just add a =COALESCE() function like in SQL ?
– Rutger Hofste
Sep 3 '18 at 14:50