# Compare-Object show mathmatical difference

**URL:** <https://forums.powershell.org/t/compare-object-show-mathmatical-difference/10462>\
**Category:** PowerShell Help\
**Created:** [April 6, 2018, 11:50am UTC](https://forums.powershell.org/t/compare-object-show-mathmatical-difference/10462 "2018-04-06T11:50:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fupaflap](https://avatars.discourse-cdn.com/v4/letter/f/94ad74/32.png) [@fupaflap](https://forums.powershell.org/u/fupaflap)\
**Post date:** [April 6, 2018, 11:50am UTC](https://forums.powershell.org/t/compare-object-show-mathmatical-difference/10462/1 "2018-04-06T11:50:43Z")

</div>

Trying to compare two excel sheets, select out a specific column and then compare the values in each row and return the difference.

I removed the side indicators cause it was throwing off my format in the post.

```
$Diff = import-csv C:\scripts\Testing_diff.csv | Select-Object Name, Volume
$reff = import-csv C:\scripts\Testing_reff.csv | Select-Object Name, Volume
Compare-Object $reff $Diff -Property Name, Volume -PassThru -IncludeEqual
```

and it just spits back the following, Trying to get it to give me back the difference of the volume data.

```
Name Volume SideIndicator
---- ------ -------------
Development_b_001 1549.50G           
Production_b_001 11.57T              
Production_b_002 1600.03G            
Development_b_001 549.50G            
Production_b_001 1.57T              
Production_b_002 600.03G
```

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [April 6, 2018, 2:01pm UTC](https://forums.powershell.org/t/compare-object-show-mathmatical-difference/10462/2 "2018-04-06T14:01:27Z")

</div>

Compare-Object will not calculate for you. It compares objects or object properties and tell if it’s equal or not. If you need to calculate a difference you will have to do it by yourself.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:35pm UTC](https://forums.powershell.org/t/compare-object-show-mathmatical-difference/10462/3 "2024-05-16T20:35:59Z")

</div>

Closed on May 16, 2024, 8:35pm UTC


