Help with Formula and Pivot Table

tbruce

Board Regular
Joined
Dec 9, 2013
Messages
77
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I'm trying to get a total count each time a specific value appears in column A. Counting is pretty straightforward with pivot tables and even formulas, but the curve ball I''m trying to work through is I need to also compare the value in cell A2 to the value is cell B2, and if the values match count as 1, but if the values are different count as 2. Here is a sampling of the data:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]A - Starting Invoice #[/TD]
[TD="align: center"]B - Ending Invoice #[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]120334[/TD]
[TD]120334[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]120353[/TD]
[TD]130343[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD]120353[/TD]
[TD]121121[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD]120334[/TD]
[TD]122323[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD]120353[/TD]
[TD]120353[/TD]
[/TR]
</tbody>[/TABLE]

I'm trying to get the desired result to produce the following list either in a pivot table or with a formula:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Invoices[/TD]
[TD="align: center"]Total Count[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]120334[/TD]
[TD="align: center"]3[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]120353[/TD]
[TD="align: center"]5[/TD]
[/TR]
</tbody>[/TABLE]


Not sure if it would be best to use a pivot table here or a formula. Any help would be much appreciated.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hello. Please reformulate your question. Your narrative doesn't match up with the tables. The bottom table essentially shows a simple conditional counting of certain values in the range [A2:B6]. Whatever you want is probably easy to do by using cell formulas.
 
Last edited:
Upvote 0
I don't know how else to reword this - the first section with table is exactly what I'm dealing with and what I'm trying for, and the second table example is what I'm hoping to generate as results either as a pivot table of other means. Any hep would be appreciated...
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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