Excel formula to diplay last billing month

Aleksandar89

New Member
Joined
Dec 12, 2017
Messages
4
Hello everyone! I have a little problem. I need a formula to show the last month for specific company.
So for example for company xyz what is the last month that items were sold and then on for company abc.
Between columns Month and Firm is also amount sold in original dataset. Does anyone have solution for this problem?

[TABLE="width: 252"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD] Month[/TD]
[TD]Firm[/TD]
[TD]Last month[/TD]
[/TR]
[TR]
[TD]Jan[/TD]
[TD]xyz[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jan[/TD]
[TD]xyz[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Feb[/TD]
[TD]xyz[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Feb[/TD]
[TD]xyz[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Feb[/TD]
[TD]xyz[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mar[/TD]
[TD]xyz[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mar[/TD]
[TD]xyz[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jan[/TD]
[TD]abc[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Feb[/TD]
[TD]abc[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I have month in column A and Firm in column B. Then in Column G I have made a unique list of the companies, i.e. xyz, and abc. In column G, I put in the following formula,

Code:
=INDEX($A$2:$A$10,LARGE(IF($B$2:$B$10=G2,ROW($A$2:$A$10)-ROW($A$2)+1),1))

You will need to adjust the cell references, but this should do what you want. Also, this is an array formula so after typing it in, hit ctrl+shift+enter to enter the formula.
 
Upvote 0
Thank you very mutch. Is maybe there another way to write formula in cell c2 in column last month and then paste down? I would like to have all that data in one table.
 
Upvote 0
Yeah, you can put the formula in C2 and it would work the same way. But there is going to be a lot of duplicate information.Not a big deal if it doesn't bother you though.
 
Upvote 0
So that formula would look like,

Code:
=INDEX($A$2:$A$10,LARGE(IF($B$2:$B$10=B2,ROW($A$2:$A$10)-ROW($A$2)+1),1))
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

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