Jump to content

If greater than or equal too


henryblake1979

Recommended Posts

hello

 

I am looking for some help

 

I am trying to code this from an excel sheet

 

I am a beginner and need a bit of advice

 

=IF($A>=6,($A-5)*$B,0)

 

The bit I am struggling with is setting the value of $A to >= 6

 

Any help or advice would be amazing.

 

Cheers

 

Henry

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/193452-if-greater-than-or-equal-too/
Share on other sites

Yes

 

I have a client who has given me an excel spreadsheet which calculates the number of components which go together to make up a single product.

 

This is for a website calculator.

 

The formula is for calculating one of the component quantities.

 

I am trying to basically transfer the excel sreadsheet into a php form. for the site

 

Any help would be great

 

Hello

 

I tried to do what you said but it brings up and error page saying unexpected ;

 

Here is my code below

 

 
<?php 
if ($_GET['calc'] == "yes")
{ 
$length = $_GET['length'];
$height = $_GET['height'];
$corners = $_GET['corners'];
$tjunctions = $_GET['tjunctions'];
$openends = $_GET['openends'];
$buttresses = $_GET['buttresses']; 
$blocx5 = ("$tjunctions"+"$openends")*("$height"/"2");
$blocx4 = "$corners"*"$height";
$blocx3 = $_GET['blocx3'];
$blocx2 = $_GET['blocx2'];
}
$blocx10 = "$length"/"0.75"*"$height"-("$blocx5"+"$blocx4")/"2";
$capping = "$length"/"1.5"-"$corners";
$cornercapping = "$corners";
$dowels = ("$blocx10"*"4")+("$blocx5"*"2")+("$blocx4"*"3");
$angle = ("$tjunctions"*"$height")+"$cornercapping";
$spike = "$length"/"2.5";
if ("$height" >= "6") {
$bq10 = (("$height"-"5)"*"$buttresses";
} 

 

Any Help would be great

<?php 
if ($_GET['calc'] == "yes")
{ 
      $length = $_GET['length'];
      $height = $_GET['height'];
      $corners = $_GET['corners'];
      $tjunctions = $_GET['tjunctions'];
      $openends = $_GET['openends'];
      $buttresses = $_GET['buttresses']; 
      $blocx5 = ($tjunctions + $openends ) * ($height / 2);
      $blocx4 = $corners * $height;
      $blocx3 = $_GET['blocx3'];
      $blocx2 = $_GET['blocx2'];
}
$blocx10 = ($length / 0.75) * $height - ($blocx5 + $blocx4) / 2;
$capping = $length/ 1.5 - $corners;
$cornercapping = $corners ";
$dowels = ($blocx10 * 4) + ($blocx5 * 2) + ($blocx4 * 3);
$angle = ($tjunctions * $height) + $cornercapping;
$spike =  $length / 2.5;
if ($height >= 6) 
{
      $bq10 = ($height - 5) * $buttresses;
} 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.