+ Reply to Thread
Results 1 to 5 of 5

Need a formula that picks the cell with a number and divides it by 18

  1. #1
    Registered User
    Join Date
    08-19-2016
    Location
    California
    MS-Off Ver
    2012
    Posts
    3

    Smile Need a formula that picks the cell with a number and divides it by 18

    I'm still on windows 7 with office 2012 which gives me Excel 2007.

    I have 4 columns, C has a time, D has a pre-meal glucose number, E has a post meal number and F converts those mmol/L numbers to mg/dl.

    The D or E columns will have a number, never will both have a number in the same row i.e. if D5 has a number E5 won't. In Column F I need a formula that divides whichever cell has the number by 18. This is the way I did get it to work, for example:

    F5 has =SUM(D5,E5)/18

    That seems simple and it works and maybe that is the way to do it. However, because I need 1 place after the decimal for the mg/dl conversion, if there is no number in either the D or E column of a row in the F column a little dash appears in the cell. I have no idea why, or maybe it isn't the formula, but I can't figure out what else would do it.

    Thanks for any help.

    Ruth
    Last edited by AliGW; 01-29-2021 at 04:16 AM. Reason: Irrelevant content of title redacted.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: not knowledgeable - need a formula that picks the cell with a number and divides it by

    It's almost certainly a zero, that has been formatted to look like a dash. What do you want to see? Then read the yellow banner (top of page) and post a small sample sheet.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,626

    Re: not knowledgeable - need a formula that picks the cell with a number and divides it by

    It is probably a custom formatting applied to the cell ?
    Perhaps post a sample sheet ( see yellow banner)

  4. #4
    Registered User
    Join Date
    08-19-2016
    Location
    California
    MS-Off Ver
    2012
    Posts
    3

    Re: not knowledgeable - need a formula that picks the cell with a number and divides it by

    Thank you for your quick response. Sorry it took me so long to make a sample, but something nice happened,
    though I have no idea why. When I was trying to make the sample, somehow I fixed the issue with that little dash.
    Not only is it not there anymore, but no 0 is there either and that fixed everything even the last cell in Column
    G which wouldn't correctly average because it would add all cells including the ones with that dash and no number.
    But, then it would divide using all the cells which made an incorrect average. Now, it only adds the cells with
    numbers and divides correctly.

    However, the formula I was using to convert the glucose numbers to HbA1c was incorrect. I found the correct one
    and I am using that. It seems to work, but I'm not sure the way I did it is the best way, so if anyone would
    check it for me I would be greatly appreciative. It is =SUM(E5,F5,46.7)/28.7 and begins at G5
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Need a formula that picks the cell with a number and divides it by 18

    The formula is fine... I would tweak it ever so slightly:

    =IF(C5="","",SUM(E5,F5,46.7)/28.7)

    so you can copy it down to the bottom of the column. It populates only when a time is entered in C. Otherwise it returns 1.6.

    Biochemically, you cannot convert spot glucose measurements to HbA1c... they are measuring entirely different things. Blood glucose reflects the situation NOW, whereas HbA1c is an approximation of the glucose load in your red blood cells over the life of an erythrocyte, which is ~120 days. If you really want to do something like that... you would need to be measuring the AREA under the blood glucose:time curve, not an average of individual measurements.

    That could be another Excel problem for another day!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with a macro that searches, write cell location and divides a number
    By CHRISTINEKENDALL93 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-29-2018, 05:59 PM
  2. Formula that picks up part of a sentence in a cell
    By ConfusedaboutVBA in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-22-2013, 03:04 AM
  3. Excel 2007 : Excel divides number input by 100
    By alex5555 in forum Excel General
    Replies: 2
    Last Post: 05-13-2010, 04:55 PM
  4. Replies: 3
    Last Post: 08-10-2009, 12:50 PM
  5. Replies: 2
    Last Post: 07-17-2008, 08:37 AM
  6. [SOLVED] CELL that picks up or inserts text with formula
    By MikeR-Oz in forum Excel General
    Replies: 2
    Last Post: 02-26-2006, 06:45 AM
  7. [SOLVED] Excel divides number by 10e6 unless followed by decimal point.
    By JohnO in forum Excel General
    Replies: 5
    Last Post: 03-21-2005, 11:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1