SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2005
    Location
    Aveiro, Portugal
    Posts
    164
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Excel formulas to PHP

    Hi!

    Could someone please help me convert this excel spreadsheet formula to php?
    I would like to use the ternary operator too.

    The formula is:
    IF (IF ( B13<1250; (3,54*B13)-2285,92; (8,38*B13)-8333,32 ) < 0; 0; IF ( B13<1250; (3,54*B13)-2285,92; (8,38*B13)-8333,32 ))

    I know that in excel, the IF statement is IF(LOGIC_TEST; VALUE_IF_TRUE; VALUE_IF_FALSE)

    Thanks,
    Mário
    Yours truely
    Mário Ramos

  2. #2
    <?php while(!sleep()){code();} G.Schuster's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $result = ($B13 1250 3.54 $B13 2285.92 8.38 $B13 8333.32) < : ($B13 1250 3.54 $B13 2285.92 8.38 $B13 8333.32); 
    Quick'n'dirty - possibly a nicer one could be produced.

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2005
    Location
    Aveiro, Portugal
    Posts
    164
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Hi G.Schuster

    Thanks for your help.
    That was just what I was looking for.

    Mario
    Yours truely
    Mário Ramos


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •