Count the lines from invoices

Alexsay

New Member
Joined
Feb 2, 2024
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I can't find in the all internet a formula to count the lines from a worksheet that contain invoices like bellow exemple
I tried with countifs,index,sumifs, counta and nothing.
If somebody can help me I will really really appreciated the effort
1707388987129.png



Thank you,
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
what do you want to count - the unique invoice numbers
so in your picture - thats 2

otherwise from the image whats the expected result


A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
Unfortunately I cant upload a xml file but you cant copy paste de bellow example and I hope its a good example

As you can see the invoice 5872839710 has 4 lines and I need a formula to start de count every time when the invoice number is changing

Invoice dateInvoice numberNumber line
what I wanna to see
Number line with formulaItem codeProduct service nameInvoiced quantityInvoiced quantity measurement code
2023-10-30587283971011Apple17CS
2023-10-30587283971022Orange75CS
2023-10-30587283971033Coconuts73CS
2023-10-30587283971043Coconuts75CS
2023-11-08587284129912Orange3CS
2023-11-08587284129922Orange3CS
2023-11-08587284129931Apple3CS
2023-11-08587284129941Apple3CS
2023-11-08587284129952Orange3CS
2023-11-07587284128811Apple17CS
2023-11-07587284128823Coconuts75CS
2023-11-07587284128832Orange73CS
2023-11-07587284128841Apple75CS
2023-11-07587284128851Apple3CS
2023-11-07587284128862Orange3CS
2023-11-10587284166613Coconuts3CS
2023-11-10587284166621Apple3CS
2023-11-10587284166632Orange3CS
2023-11-10587284166643Coconuts17CS
2023-11-10587284166652Orange75CS
2023-11-10587284166661Apple73CS
2023-11-10587284166673Coconuts75CS
2023-11-10587284166681Apple3CS
 
Upvote 0
=COUNTIF($B$3:B3,B3)

or to avoid 0 in blank cells

=IF(B3="","",COUNTIF($B$3:B3,B3))

see in column I results

Book4
ABCDEFGHI
1Invoice dateInvoice numberNumber lineNumber line with formulaItem codeProduct service nameInvoiced quantityInvoiced quantity measurement code
2what I wanna to seeresult
310/30/23587283971011Apple17CS1
410/30/23587283971022Orange75CS2
510/30/23587283971033Coconuts73CS3
610/30/23587283971043Coconuts75CS4
711/8/23587284129912Orange3CS1
811/8/23587284129922Orange3CS2
911/8/23587284129931Apple3CS3
1011/8/23587284129941Apple3CS4
1111/8/23587284129952Orange3CS5
1211/7/23587284128811Apple17CS1
1311/7/23587284128823Coconuts75CS2
1411/7/23587284128832Orange73CS3
1511/7/23587284128841Apple75CS4
1611/7/23587284128851Apple3CS5
1711/7/23587284128862Orange3CS6
1811/10/23587284166613Coconuts3CS1
1911/10/23587284166621Apple3CS2
2011/10/23587284166632Orange3CS3
2111/10/23587284166643Coconuts17CS4
2211/10/23587284166652Orange75CS5
2311/10/23587284166661Apple73CS6
2411/10/23587284166673Coconuts75CS7
2511/10/23587284166681Apple3CS8
Sheet1
Cell Formulas
RangeFormula
I3:I25I3=IF(B3="","",COUNTIF($B$3:B3,B3))
 
Upvote 0
oh, I can't believe :) Thanks a lot man, I really appreciate your help!
Definitely I need more excel courses:D
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,977
Members
449,095
Latest member
Mr Hughes

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