+ Reply to Thread
Results 1 to 56 of 56

Averaging and Rounding problem

  1. #1
    Registered User
    Join Date
    06-20-2005
    Posts
    7

    Averaging and Rounding problem

    I would greatly appreciate it if somebody could help me figure out this excel equation. Ok, here are the parameters:

    I have 2 types of information in two cells labeled as H101 and H102. In the cells there can be positive or negative numbers, 0, or they can read “N/A” which means I have no information for that cell. I am pulling information from both of these cells and putting them into a single cell. Here is what I need:

    1) If both cells H101 and H102 have numbers that are the SAME I want the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them AVERAGED and then ROUNDED

    Here is my problem, I need to average and round a number ONLY when the two cells have numbers in them AND the two numbers are different. If one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out and not rounded. I only want to round numbers to the nearest hundreth when numbers are in both cells AND they are different. Here is the equation I have come up with so far:

    =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102), 1))))))))))

    This equation keeps rounding all numbers and I only want to round them when both cells contain numbers that are DIFFERENT. If anybody can tell me how I can structure this so that I only round a number when I find the average of them I would greatly appreciate it. Thank you! :-)

    ps: feel free to change the format of this equation also, I am sure there is a shorter way to do this!

  2. #2
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  3. #3
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  4. #4
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  5. #5
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  6. #6
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




  7. #7
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  8. #8
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  9. #9
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  10. #10
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  11. #11
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




  12. #12
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  13. #13
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




  14. #14
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  15. #15
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  16. #16
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  17. #17
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




  18. #18
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  19. #19
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  20. #20
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  21. #21
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  22. #22
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  23. #23
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  24. #24
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  25. #25
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




  26. #26
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  27. #27
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  28. #28
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  29. #29
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  30. #30
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




  31. #31
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  32. #32
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  33. #33
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  34. #34
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




  35. #35
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  36. #36
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  37. #37
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  38. #38
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  39. #39
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  40. #40
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  41. #41
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




  42. #42
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




  43. #43
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  44. #44
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  45. #45
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  46. #46
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  47. #47
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  48. #48
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




  49. #49
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  50. #50
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  51. #51
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  52. #52
    Biff
    Guest

    Re: Averaging and Rounding problem

    Hi!

    Try this:

    =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))

    Format as NUMBER 2 decimal places.

    Biff

    "Hansel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I would greatly appreciate it if somebody could help me figure out this
    > excel equation. Ok, here are the parameters:
    >
    > I have 2 types of information in two cells labeled as H101 and H102. In
    > the cells there can be positive or negative numbers, 0, or they can read
    > "N/A" which means I have no information for that cell. I am pulling
    > information from both of these cells and putting them into a single
    > cell. Here is what I need:
    >
    > 1) If both cells H101 and H102 have numbers that are the SAME I want
    > the number pulled out and NOT rounded
    > 2) If both cells are N/A I want the N/A pulled out.
    > 3) If one cell is N/A and the other is a number, I want the number
    > pulled out and NOT rounded
    > 4) If both cells are numbers AND they are DIFFERENT I want them
    > AVERAGED and then ROUNDED
    >
    > Here is my problem, I need to average and round a number ONLY when the
    > two cells have numbers in them AND the two numbers are different. If
    > one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    > and not rounded. I only want to round numbers to the nearest hundreth
    > when numbers are in both cells AND they are different. Here is the
    > equation I have come up with so far:
    >
    > =IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    > F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    > 1))))))))))
    >
    > This equation keeps rounding all numbers and I only want to round them
    > when both cells contain numbers that are DIFFERENT. If anybody can tell
    > me how I can structure this so that I only round a number when I find
    > the average of them I would greatly appreciate it. Thank you! :-)
    >
    > ps: feel free to change the format of this equation also, I am sure
    > there is a shorter way to do this!
    >
    >
    > --
    > Hansel
    > ------------------------------------------------------------------------
    > Hansel's Profile:
    > http://www.excelforum.com/member.php...o&userid=24470
    > View this thread: http://www.excelforum.com/showthread...hreadid=380726
    >




  53. #53
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Hansel,

    Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    last requirement.

    HTH,
    Bernie
    MS Excel MVP



    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > Try this:
    >
    > =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >
    > Format as NUMBER 2 decimal places.
    >
    > Biff




  54. #54
    Biff
    Guest

    Re: Averaging and Rounding problem

    >I only want to round numbers to the nearest hundreth

    =ROUND(AVERAGE(10,15),2) = ???

    I'm assuming they want 12.50 vs 12.5 that's why I used the number format.

    Biff

    "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    news:[email protected]...
    > Hansel,
    >
    > Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    > last requirement.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    >
    > "Biff" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi!
    >>
    >> Try this:
    >>
    >> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>
    >> Format as NUMBER 2 decimal places.
    >>
    >> Biff

    >
    >




  55. #55
    Ron Rosenfeld
    Guest

    Re: Averaging and Rounding problem

    On Mon, 20 Jun 2005 18:17:27 -0500, Hansel
    <[email protected]> wrote:

    >
    >I would greatly appreciate it if somebody could help me figure out this
    >excel equation. Ok, here are the parameters:
    >
    >I have 2 types of information in two cells labeled as H101 and H102. In
    >the cells there can be positive or negative numbers, 0, or they can read
    >“N/A” which means I have no information for that cell. I am pulling
    >information from both of these cells and putting them into a single
    >cell. Here is what I need:
    >
    >1) If both cells H101 and H102 have numbers that are the SAME I want
    >the number pulled out and NOT rounded
    >2) If both cells are N/A I want the N/A pulled out.
    >3) If one cell is N/A and the other is a number, I want the number
    >pulled out and NOT rounded
    >4) If both cells are numbers AND they are DIFFERENT I want them
    >AVERAGED and then ROUNDED
    >
    >Here is my problem, I need to average and round a number ONLY when the
    >two cells have numbers in them AND the two numbers are different. If
    >one cell reads 4.65 and the other cell is N/A I want 4.65 pulled out
    >and not rounded. I only want to round numbers to the nearest hundreth
    >when numbers are in both cells AND they are different. Here is the
    >equation I have come up with so far:
    >
    >=IF((AND(H101="N/A",H102="N/A")),"N/A",(IF((AND(H101>0,H101<0,H101=0,H102="N/A")),VALUE(H101),(IF((AND(H102>0,H102<0,H102=0,H101="N/A")),VALUE(H102),(IF(AND((H101=H102)),VALUE(H101),(I
    >F((OR(H101<>H202,H101<>"N/A",H202<>"N/A")), ROUND(AVERAGE(H101,H102),
    >1))))))))))
    >
    >This equation keeps rounding all numbers and I only want to round them
    >when both cells contain numbers that are DIFFERENT. If anybody can tell
    >me how I can structure this so that I only round a number when I find
    >the average of them I would greatly appreciate it. Thank you! :-)
    >
    >ps: feel free to change the format of this equation also, I am sure
    >there is a shorter way to do this!


    It looks as if you are entering the N/A as text and it is not the result of a
    formula.

    So try this formula:

    =IF(COUNT(H101:H102)=0,H101,
    IF(AND(COUNT(H101:H102)=2,H101<>H102),
    ROUND(AVERAGE(H101:H102),2),AVERAGE(H101:H102)))


    --ron

  56. #56
    Bernie Deitrick
    Guest

    Re: Averaging and Rounding problem

    Biff,

    Formatting only affects display and not the actual number, so any subsequent
    calculations would be affected.

    The OP explicitly requested rounding to two decimal places only if the
    numbers were different.

    1) If both cells H101 and H102 have numbers that are the SAME I want
    the number pulled out and NOT rounded
    2) If both cells are N/A I want the N/A pulled out.
    3) If one cell is N/A and the other is a number, I want the number
    pulled out and NOT rounded
    4) If both cells are numbers AND they are DIFFERENT I want them
    AVERAGED and then ROUNDED

    Bernie


    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > >I only want to round numbers to the nearest hundreth

    >
    > =ROUND(AVERAGE(10,15),2) = ???
    >
    > I'm assuming they want 12.50 vs 12.5 that's why I used the number format.
    >
    > Biff
    >
    > "Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
    > news:[email protected]...
    >> Hansel,
    >>
    >> Change the AVERAGE(H101:H102) to ROUND(AVERAGE(H101:H102),2) to meet the
    >> last requirement.
    >>
    >> HTH,
    >> Bernie
    >> MS Excel MVP
    >>
    >>
    >>
    >> "Biff" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi!
    >>>
    >>> Try this:
    >>>
    >>> =IF(OR(H101="",H102=""),"",IF(COUNTIF(H101:H102,"N/A")=2,"N/A",IF(COUNT(H101:H102)=1,MAX(H101:H102),IF(H101=H102,H101,AVERAGE(H101:H102)))))
    >>>
    >>> Format as NUMBER 2 decimal places.
    >>>
    >>> Biff

    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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