PHPackages                             p4/excel-goalseek - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. p4/excel-goalseek

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

p4/excel-goalseek
=================

Utility to emulate goalseek function in PHP

v2.0.0(4y ago)020.5k↓41.1%MITPHPPHP &gt;=7.2.0

Since Sep 2Pushed 4y agoCompare

[ Source](https://github.com/p4lv/Excel-GoalSeek)[ Packagist](https://packagist.org/packages/p4/excel-goalseek)[ Docs](https://github.com/davidjr82/PHP-Excel-GoalSeek)[ RSS](/packages/p4-excel-goalseek/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (4)Versions (6)Used By (0)

Excel-GoalSeek
==============

[](#excel-goalseek)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b7f36ed1d2456bd049705de7cd8eb7803079d4568d7ded5a50635963575d7aa6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70346c762f457863656c2d476f616c5365656b2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/p4lv/Excel-GoalSeek/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/1639b5f9911885f1c4d45754d290cec5fe838ba4946e4483715450a5b13ff2b4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70346c762f457863656c2d476f616c5365656b2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/p4lv/Excel-GoalSeek/?branch=master)[![Build Status](https://camo.githubusercontent.com/e672574d4b4dbb40a96e478faf639e65d91664fe9a1807cf8e01d6f66887f074/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70346c762f457863656c2d476f616c5365656b2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/p4lv/Excel-GoalSeek/build-status/master)[![Code Intelligence Status](https://camo.githubusercontent.com/856ce78334b1edbed2cf0c5d0cd071732d4c124e133cbc87f2a1bcf9f069999c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70346c762f457863656c2d476f616c5365656b2f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)

Utility to emulate goalseek function in PHP. This fork was made for very specific project, and there is no promise to keep any BC.

This library is a fork of [PHP-Excel-GoalSeek](https://github.com/juanjomip/PHP-Excel-GoalSeek)

Install
-------

[](#install)

Use package from packagist.

```
composer require p4/excel-goalseek
```

Usage
-----

[](#usage)

```
//Define function which for which the value should be found
$callbackTest = function callbackTest($input) {
    $inputForCallbackTest2 = $input * 8;
    return $inputForCallbackTest2 - 12;
};

//Instantiate goal seek class
$goalseek = new ExcelGoalSeek();
//$goalseek->debug = true;

//I want to know which input needs callbackTest to give me 301
$expected_result = 300;

//Calculate the input to get you goal, with accuracy
$input = $goalseek->calculate($callbackTest, $expected_result, 5);

//Voilá!
echo "\$input: " . $input . "";

//Let's test our input it is close
$actual_result = $callbackTest($input);
//Searched result of function
echo "Searched result of $callbackTest(\$input) = " . $expected_result . "";
//Actual result of function with calculated goalseek
echo "Actual result of $callbackTest(" . $input . ") = " . $actual_result . "";
//If difference is too high, you can improve the class and send me it your modifications ;)
echo "Difference = " . ($actual_result - $expected_result);
```

Testing
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [David Jiménez](https://github.com/davidjr82)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

1766d ago

Major Versions

v1.0.2 → v2.0.02021-09-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/040a427799e92521b7134f2f8485eee0fe3f8eaf0de1cdaf5b1da6e280a04ff1?d=identicon)[pomaxa](/maintainers/pomaxa)

---

Top Contributors

[![pomaxa](https://avatars.githubusercontent.com/u/426649?v=4)](https://github.com/pomaxa "pomaxa (36 commits)")[![artjomsfed](https://avatars.githubusercontent.com/u/89962448?v=4)](https://github.com/artjomsfed "artjomsfed (1 commits)")[![davidjr82](https://avatars.githubusercontent.com/u/4275886?v=4)](https://github.com/davidjr82 "davidjr82 (1 commits)")

---

Tags

phpexcelgoalseekedattae-dattadavidjr82PHP-Excel-GoalSeek

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/p4-excel-goalseek/health.svg)

```
[![Health](https://phpackages.com/badges/p4-excel-goalseek/health.svg)](https://phpackages.com/packages/p4-excel-goalseek)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[pontedilana/php-weasyprint

PHP library allowing PDF generation from an url or a html page. Wrapper for Kozea/WeasyPrint.

781.2M17](/packages/pontedilana-php-weasyprint)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
