Search for number in different column

AlexPi

Board Regular
Joined
Apr 4, 2011
Messages
104
I'm trying to summarize a P&L report taken from accounting software (later to be used in a pivot table, but need to get the data formatted) and I need some help using the search functions in excel.

Here is an example of the data which is imported into excel
Code:
A                   B 
1 4010 · Sales
2              4011 · Hardware
3              4013 · Audio Sales
4              4014 · Licensing

What I am trying to do is say something like IF(LEFT(B2,1)=LEFT(A1,1),A1,0)

Basically trying to search for the left most number in coumn B and return the heading that is in column A. There is missing data in Column A so I want the formula to use the next cell with data above it one column to the left.

I have tried using something like this but without much luck...

IF(ISTEXT(OFFSET(B2,-1,-1,1,1)),OFFSET(B2,-1,-1,1,1)/2,OFFSET(B2,-1,-1,1,1))

Anyone see any problems in the formula I am using or have any ideas?

Thanks for your help!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I ended up just using a bit of code to get this done...here it is in case someone needs this in the future...

Code:
Sub Fillinblanks()
For Each cell In Selection
On Error Resume Next
If cell.Value = "" Then cell.Value = cell.Offset(-1, 0).Value
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,617
Messages
6,179,915
Members
452,949
Latest member
beartooth91

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