+ Reply to Thread
Results 1 to 9 of 9

If cell value > 39 do calculation, otherwise return the cell value

  1. #1
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    If cell value > 39 do calculation, otherwise return the cell value

    This works fine, but if F15 contains text, the output cell gives a value error. How can I amend so it returns the text value?

    =IF(F15>39,G15/2,F15)
    Last edited by Barking_Mad; 07-12-2017 at 11:12 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: If cell value > 39 do calculation, otherwise return the cell value

    Try

    =IF(ISNUMBER(F15),IF(G15/2,F15),F15)

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: If cell value > 39 do calculation, otherwise return the cell value

    I think John meant:

    =IF(ISNUMBER(F15),IF(F15>39,G15/2,F15),F15)

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: If cell value > 39 do calculation, otherwise return the cell value

    Good catch!!!

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: If cell value > 39 do calculation, otherwise return the cell value



    =IF(F15>39,IF(ISNUMBER(G15),G15/2,G15),F15)

  6. #6
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: If cell value > 39 do calculation, otherwise return the cell value

    Super! Thanks muchly

  7. #7
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: If cell value > 39 do calculation, otherwise return the cell value

    I have a similar problem, and rather starting another thread I thought Id add it here. The following works:

    =IF(AND(G16>39,I16=30,M16="NAME"),SUM(H16,L16),"")

    But only when G16 and I16 are numbers, not text. When they are text it does the sum (H16,L16) regardless. Can the solution given in post #3 be altered to work in a similar way?

  8. #8
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: If cell value > 39 do calculation, otherwise return the cell value

    Try this:
    =IF(AND(N(G16)>39,I16=30,M16="NAME"),SUM(H16,L16),"")

    or this (similar to post#3):
    =IF(AND(ISNUMBER(G16),G16>39,I16=30,M16="NAME"),SUM(H16,L16),"")
    Last edited by leelnich; 07-12-2017 at 11:48 AM.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: If cell value > 39 do calculation, otherwise return the cell value

    Try

    =IF(AND(ISNUMBER(G16),ISNUMBER(I16)),IF(AND(G16>39,I16=30,M16="NAME"),SUM(H16,L16),""),"")

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. return multiple header cell values into one cell concatenated based on a cell value
    By anchuri_chaitanya in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-13-2016, 10:27 PM
  2. [SOLVED] If a cell is blank/empty return a value or perform a calculation
    By mel_lopez in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-28-2016, 05:27 AM
  3. [SOLVED] IF FUNCTION Help - IF Cell= X Then Perform This Calculation, Otherwise Return Value of 0
    By JONBOY666 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-30-2015, 07:21 AM
  4. Using a vlookup return cell with mixed elements in a subsequent calculation
    By jonesyhouse in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-10-2012, 07:45 AM
  5. Replies: 3
    Last Post: 06-20-2012, 07:16 AM
  6. Replies: 6
    Last Post: 03-21-2009, 11:43 AM
  7. Replies: 2
    Last Post: 01-19-2009, 08:44 PM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1