IF statements and columns

AndrePrevin

New Member
Joined
Jan 13, 2019
Messages
8
Hi all, really need your help

I have a series of values and blanks randomly distributed in one column and I want to set up a formula in the next column which looks at the first column and says, if there is a value in first column then take that value, otherwise if there is a blank then use the last cell in which a number occurred.

But where it gets a bit complicated is - I want the formula to update the value which it uses from the first column every time a new number occurs in that column, meaning that as the first column encounters a new value after a series of blanks, the formula will discard the old or previous value and take the new one

To give an idea of what I mean, column B's formula must display the last value from column A even when it encounters blanks in column A until it encounters a new value in column A at which point it must update its output to that new encountered value from column A

Column AColumn B
44
4
4
22
2
2

<tbody>
</tbody>

Not sure if this is even possible but I will be really grateful if some kind person could help me with this, please

Thank you
Kind regards
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi & welcome to MrExcel.
How about


Excel 2013/2016
AB
1Column AColumn B
244
34
44
522
62
72
Sheet2
Cell Formulas
RangeFormula
B2=IF(A2="",N(B1),A2)
 
Upvote 0
Hi & welcome to MrExcel.
How about

Excel 2013/2016
AB
1Column AColumn B
244
34
44
522
62
72

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
B2=IF(A2="",N(B1),A2)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Thanks, I tried that but does not seem to be working for me
 
Upvote 0
does not seem to be working for me

do your columns have headers or does data start in row 1? i think Fluff's formula needs you to have a header row.
otherwise use the formula starting in row 2 and just enter the first value manually
 
Upvote 0
Can you please give an accurate sample of your data & explain why the suggestions made "do not work"
 
Upvote 0
Hi Fluff, my apologies I just realised the mistake was mine. Your formula works perfectly.
Thank you so much

If its not too much trouble, can I request your help further?
I have some more functions I need to set up in my spreadsheet

I will attach a sample workbook to make things clearer

Kind regards
 
Upvote 0
This sounds like a different question, in which case you will need to start a new thread.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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