+ Reply to Thread
Results 1 to 23 of 23

MID function problem

  1. #1
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    MID function problem

    Respected,
    4
    -202.15
    6.9
    -17.9
    13
    11MID.xlsx



    -15.38 (2.33#-0.35)
    Problem(1)
    AVERAGE -0.35 should come -30~ but as mid is only considering first 3 , while A2(-202) has 4
    Problem(2)
    mid function IS USED AS ONLY RELEVANT NUMBERS FROM A STRING HAS TO BE CONSIDERED
    BUT THIS CREATED PROBLEM WHEN THE NUMBER OF NUMERALS TO BE CONSIDERED ARE NOT ENOUGH AND HAS OTHER CHARACTER/SYMBOLS BEHIND THE SIGN(WHICH IS NORMAL)
    In future the case can come where there may be character/symbols ahead of it and delimiter used is # , so if possible make that version also
    So has to make formula such that only numerals that are at starting of value is considered(till 1 places after decimal, if there is decimal)

    Zohar Batterywala
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: MID function problem

    Hello Zohar,

    Welcome to the forum.

    Try array-entering this in C7.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

    Does this solve the first part of your question?
    Dave

  3. #3
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Hi Flameretired,
    Worked , But am not able to understand this at this moment. ALSO I have to use this formula in a big excel file where this calculation has to be modified for 1000+ calculations, so it will be helpful for me if you can PLEASE PLEASE explain.
    THANKS
    Zohar Batterywala

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: MID function problem

    I'll do my best.

    I attempted to discern the criteria patterns.

    I reasoned that numbers < 0 are a special case that only require the integer portion to be returned. So --LEFT(A1:A6,FIND(".",$A$1:$A$6)) only executes if < 0 returns TRUE.

    The FIND function returns the character position of ".". LEFT returns that many left-most characters. The "--" before LEFT coerces the resulting text "numbers" to their numeric values.

    Where numbers are > = 0 they remain unchanged.

    All resulting values are "hidden" in an array. If you were to select just this part of the formula in the formula bar and press

    the F9 function key IF(A1:A6<0,--LEFT(A1:A6,FIND(".",$A$1:$A$6)),A1:A6) you would see this array that is the combined result of that IF function {4;-202;6.9;-17;13;11}.

    This array is passed to AVERAGE which returns -30.6833333333333. ROUND of course shortens that to -30.68.

    If you are interested in an alternative formula you can skip the LEFT / FIND and use the TRUNC function. I had overlooked that option. I have almost never had cause to use it.

    That shortened formula would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It is still array entered. TRUNC is the shorter way to return the left-of-decimal portion of negative numbers.

    Also if you are interested there are two devices you can use to analyze formulas. One is the F9 key mentioned above and the other is an Excel feature called 'Evaluate formula'.

    With one of the cells containing the formula active click on FORMULAS > Evaluate formula. A window appears. Click the EVALUATE button repeatedly and Excel will show

    how it evaluates the formula step by step.

    These two tools are excellent aids for dissecting formulas and self instruction. I recommend them whenever I can.

    Did this help?
    Last edited by FlameRetired; 09-07-2016 at 06:55 PM.

  5. #5
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    HI Flameretired,

    THANK YOU VERY VERY MUCH for showing me the new thing in excel. THANK YOU.

    It will take me some time to understand(a day or two).

    Can you please please mention me the best place where I can read about the ARRAY FUNCTIONS and what should I find in Help of excel(mine is Office 2007 on win 8.1)

    Can the ARRAY FORMULAS work when cells are apart and inbetween cells are not to be counted LIKE

    All this is for understanding, (Mostly I am not so expert.)
    values of A1, A4, A8, A12, B2, B5, B9, B13 of Sheet 1 has only to be considered.
    and its answer needed in Another SHeet(sheet 2) at A6.

    All the other formulas I will make from this example is averaging monthly(values 30 days apart-originally 90 rows apart as after every set of values taken one row is left blank and in one row daily values comparing to previous days values are calculated) and weekly(values 7 days apart-originally 21 rows apart) data AND so inbetween cells has not to be considered.

    Also

    Can you please make(if possible) the above formula in normal way.

    Zohar Batterywala

    THANK YOU AGAIN

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: MID function problem

    Can you please please mention me the best place where I can read about the ARRAY FUNCTIONS and what should I find in Help of excel(mine is Office 2007 on win 8.1)
    It is best to get a foundational understanding of array fundamentals first. This is a good place to start.

    http://xldynamic.com/source/xld.SUMPRODUCT.html

    After that study the many examples that show up here on the forum, and of course apply F9 and Evaluate formula to them.

    I'll have a look at the rest.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: MID function problem

    Can the ARRAY FORMULAS work when cells are apart and inbetween cells are not to be counted LIKE

    All this is for understanding, (Mostly I am not so expert.)
    values of A1, A4, A8, A12, B2, B5, B9, B13 of Sheet 1 has only to be considered.
    and its answer needed in Another SHeet(sheet 2) at A6.

    All the other formulas I will make from this example is averaging monthly(values 30 days apart-originally 90 rows apart as after every set of values taken one row is left blank and in one row daily values comparing to previous days values are calculated) and weekly(values 7 days apart-originally 21 rows apart) data AND so inbetween cells has not to be considered.
    zoharsb,

    You will need to upload another example file of what you describe there.

    Also

    Can you please make(if possible) the above formula in normal way.
    My first thought is ... yes, but it will likely require a helper column step. Those can be hidden for aesthetic purposes. I will work on that.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: MID function problem

    Here is what I mean by helper column.

    In D1 of below this formula filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then in C7 the final formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.





    A
    B
    C
    D
    1
    4
    4
    2
    -202.15
    -202
    3
    6.9
    6.9
    4
    -17.9
    -17
    5
    13
    13
    6
    11
    11
    7
    -15.38 (2.33#-0.35)
    2.33
    -30.68

  9. #9
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Respected Flameretired,
    Has attached the edited worksheet as asked by you.
    Attached Files Attached Files

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: MID function problem

    zoharsb,

    I am near completely lost. I only have one question to start with.

    Most of the figures in column C are offset one row below their respective dates. Does this have to be this way?

    Although I cannot discern the logic of the intended outputs (so far) I feel certain that this would be simpler if all figures were aligned with their dates.

    Is that acceptable?

  11. #11
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Sir,

    The figures are calculated from daily volume (WEEKLY AND MONTHLY) and what is the difference they make weekly or monthly can help to decide future trends.
    So it is that way.

    At present I am at my workplace so do not have the original file from which this figures are taken.
    I am attaching link of the original file that is 168 MB about 3 month ago but now is of 207 MB and will increase by more 4 MB this week as I will add data.
    https://www.dropbox.com/s/521p0aq8qa...done.xlsx?dl=0

  12. #12
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Respected,
    Please have a look as its important
    Zohar Batterywala

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: MID function problem

    zoharsb,

    Many of us (including me) are reluctant to download from 3rd party file hosting sites.

    If you upload directly to the forum with a much smaller example I will have another look at it. Presently I do not understand the latest upload post #9.

    I can not see the logic in the expected outputs or the instructions. As stated earlier the sometimes offset rows sometimes not offset feature still confuses me.

    Maybe someone else watching this thread will be able to help us both.

  14. #14
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Respected Flameretired,
    The format of the file in which this has to be added(to calculate) is:

    Every day at end of day, the date of that day is added

    say the date is 1-sep on A1

    after that one line(ROW) is left blank(as other data that is added is of 2 lines(ROWS) and one line is needed for calculation)

    a week can have 4 or 5 days(A1-A10 or A1 to A13) and so difference has to be maintained.
    pictorially-
    A1(DATA OF 1-SEP)
    A2(blank)
    A3(calculated data of 1-sep)
    A4(DATA OF 2-SEP)
    A5(blank)
    A6(calculated data of 2-sep)
    A7(DATA OF 3-SEP)
    A8(blank)
    A9(calculated data of 3-sep)
    A10(DATA OF 4-SEP)
    A11(blank)
    A12(calculated data of 4-sep)
    A13(DATA OF 5-SEP)
    A14(blank)
    A15(CALCULATED DATA OF WEEK)
    Now the data of A3-
    FOR WEEKLY-Now the data that is only on A3-A6-A9-A12 is only to be considered ( I will manage all that is not as per routine ---- like 4 days week, etc. etc.) .
    THE DATA ON A1-A4-A7-A10(AND A13) HAS NOT TO BE CONSIDERED.
    Hope I can make the things clear. If not you can message me anytime for anything(my email ID is---- zoharsb at gmail dot com)

    Zohar Batterywala

  15. #15
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Respected,
    Any solution?
    Zohar Batterywala

  16. #16
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: MID function problem

    Zohar,

    No. I am not able to come up with solution. I have resorted to guessing and have found no way to arrive at the expected figures.

    I am unable to help. I am sorry.

  17. #17
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    HI Flameretired,
    In anyway THANK YOU for the Showing me the newthing(array functions)
    Zohar Batterywala

  18. #18
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Respected,
    I am not much expert. So cant understand this all but may guide you to help me.
    Has find two links by which my problem for MID function can be solved ----seems.

    https://www.extendoffice.com/documen...string.html#a1
    https://excelxor.com/2015/06/29/simu...-in-a-string/+


    Zohar Batterywala

  19. #19
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Respected,

    Am posting again as in previous reply the link seems to be truncated and was not working.

    I am not much expert. So cant understand this all but may guide you to help me.
    Has find two links by which my problem for MID function can be solved ----seems.

    https://www.extendoffice.com/documen...string.html#a1
    https://excelxor.com/2015/06/29/simu...s-in-a-string/

    Zohar Batterywala

  20. #20
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Respected Sir,
    Has again tried to reformat the request PLEASE PLEASE have a look.
    ITs important

    C63 in the attached file is the required result-it is

    (1)% wise difference between last 2 days
    (2)2Day average of the original value
    (3)3Day average of the original value (data feed done-NOT calculated figure)
    (4)weekly average of the original value (data feed done-NOT calculated figure)

    All four results on in same cell connected by &


    Sir, Please Please understand that I am not 24X7 online but am able to check mail at every 2-3 hours and so replied immediately as soon as you asked. PLEASE PLEASE help me to get the solution as this will solve many of my issues(relating to inflow from dam-to-reservoir, reservoir-to canal, and many,
    there are 7 calculation in each line and there are such 4dams*13reservoirs*15canals=780* 360 days -280,800 lines,

    If I have to change MID values in each, it will take me a month or so, and even that if done will not solve the problem as the persons who will be really using night not have required know-how.

    PLEASE PLEASE

    Zohar Batterywala
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Respected ,
    Please Please help.
    Zohar Batterywala

  22. #22
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,851

    Re: MID function problem

    crossposted; http://www.ozgrid.com/forum/showthread.php?t=201014

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  23. #23
    Registered User
    Join Date
    09-06-2016
    Location
    ahmedabad
    MS-Off Ver
    2007-2016
    Posts
    52

    Re: MID function problem

    Respected Sir ,
    I have first posted on that forum but has not got any response till 7-8 days so I posted also here(but till now also has not got any solution PLEASE PLEASE this has to be implemented at more than 300000+ places for which I will do the needed changes but atleast once I should get the idea)
    This is the link----
    http://www.ozgrid.com/forum/showthread.php?t=201014

    Zohar Batterywala

+ 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. [VBA] Problem with outmail function - function sends mails only to 1 recepient
    By sauron12 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2015, 03:30 PM
  2. [SOLVED] Problem With NPV function
    By brendonagius in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-31-2014, 04:35 AM
  3. Replies: 6
    Last Post: 10-20-2013, 07:16 PM
  4. [SOLVED] Sum function problem
    By zippypong in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-03-2013, 09:05 PM
  5. Problem Inserting Round function into an IF function
    By Ash87 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-11-2013, 05:37 PM
  6. IF function problem
    By conks in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-24-2008, 11:21 AM
  7. if function problem
    By jerryw in forum Excel General
    Replies: 8
    Last Post: 04-01-2007, 08:26 AM

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