Date & Time Functions: TODAY, NOW, DATEDIF

કારણ કે Excel dates ને serial numbers તરીકે store કરે છે, TODAY અને NOW એક live ઘડિયાળ આપે છે, બે dates ને બાદ કરવું વચ્ચેના દિવસ આપે છે, અને DATEDIF dates વચ્ચે ચોક્કસ years, months કે days ગણે છે, age, tenure અને overdue ગણતરીઓ માટે બિલકુલ સાચું.

9 min read · 9 cards · 2 checks

Read in: English · हिन्दी · ગુજરાતી


Theory

એ કેટલા સમયથી member છે?

Meera એક loyalty scheme ચલાવે છે અને દરેક customer નું ચોક્કસ tenure ઇચ્છે છે: ફક્ત 'લગભગ 2 વર્ષ' નહીં પણ '2 વર્ષ, 3 મહિના'. એ supplier invoices ને days overdue થી flag પણ કરવા માંગે છે.

બંને date ગણિત છે, અને બંને સહેલા છે એક તથ્ય ના કારણે જે તમે પહેલેથી જાણો છો: Excel દરેક date ને એક serial number તરીકે store કરે છે (BCA105). એ એક idea એટલે dates ને કોઈ પણ number ની જેમ બાદ, સરખાવી અને માપી શકાય.

આ lesson એ તથ્ય ને practical tools માં બદલે છે: TODAY, NOW, સાદો બાદબાકી, અને ચોક્કસ DATEDIF.

Theory

Dates બસ દિવસ-numbers છે

એક વિશાળ ફૂટપટ્ટીની કલ્પના કરો જ્યાં દરેક દિવસનો એક number છે (દિવસ 1 = 1 જાન્યુ 1900, આજે ~46,000 સુધી). એક વાર એક date એ ફૂટપટ્ટી પર એક number છે, 'વચ્ચે કેટલા દિવસ?' બસ બાદબાકી છે, અને 'કેટલું જૂનું?' અંતર માપવું છે. Excel આ numbers ને તમારા માટે calendar dates તરીકે સજાવે છે, પણ નીચે, date ગણિત ફૂટપટ્ટી પર સાદો arithmetic છે. એ જ કારણ છે કે નીચે બધું કામ કરે છે.

At a glance

Date toolkit

Functionપાછું આપે છેઉપયોગ
TODAY()મોજૂદા date (live)Days overdue, age
NOW()મોજૂદા date ANE timeTimestamps
date2 - date1વચ્ચેના daysInvoice age
DATEDIF(a, b, "Y")વચ્ચેના complete yearsAge, tenure
DATEDIF(a, b, "M")વચ્ચેના complete monthsMonths of service

Theory

DATEDIF: ચોક્કસ age અને tenure

સાદો બાદબાકી days આપે છે; years અને months માટે તમને DATEDIF(start, end, unit) જોઈએ:

  • "Y" -> dates વચ્ચે complete years.
  • "M" -> complete months.
  • "D" -> days.
  • "YM" -> પૂરા years પછી બચેલા months ('2 વર્ષ 3 મહિના' માટે).

તો =DATEDIF(joindate, TODAY(), "Y") membership ના પૂરા years આપે છે, અને "Y" તથા "YM" જોડવું ચોક્કસ '2 વર્ષ 3 મહિના' આપે છે. અને કારણ કે TODAY() live છે, tenure સમય વીતવા સાથે પોતાને update કરે છે. (DATEDIF એક છુપાયેલ રત્ન છે, Excel એને autocomplete પણ નથી કરતું, પણ એ પૂરી રીતે સમર્થિત છે.)

Quiz

Aryan એક member ની age માટે =DATEDIF(A2, TODAY(), "Y") ગણે છે. આવતા વર્ષે એ file ખોલે છે. age નું શું થાય છે?

  1. એ આપોઆપ વધે છે, TODAY() live છે તો age ફરી ગણાય છે
  2. એ એ જ રહે છે, DATEDIF value ને થીજવી દે છે
  3. એ એક વર્ષ પછી error બતાવે છે
  4. એ zero પર reset થઈ જાય છે
Show the answer

એ આપોઆપ વધે છે, TODAY() live છે તો age ફરી ગણાય છે

TODAY() ફરી ગણે છે દર વખતે જ્યારે file ખૂલે કે recalc થાય, તો TODAY() સામે માપેલી age કે tenure સમય સાથે પોતાને update કરે છે, આવતા વર્ષે એ એક વર્ષ વધુ, આપોઆપ. એ સામાન્ય રીતે એ જ છે જે તમે 'મોજૂદા age' માટે ઇચ્છો છો. જો તમને એક થીજેલો snapshot જોઈએ ('signup પર age'), તો તમે એક static date (Ctrl+;) વાપરત. live-વિરુદ્ધ-static પસંદગી મુખ્ય exam ભેદ છે.

Think first

Days overdue

એક supplier invoice B2 માં date પર due હતી. Aryan ને આજની તારીખ સુધી 'days overdue' જોઈએ. formula નો idea લખો, અને સમજાવો કે એ કોઈ ખાસ date function વગર કેમ કામ કરે છે.

Show the answer

=TODAY() - B2. કારણ કે બંને date ફૂટપટ્ટી પર serial numbers છે, due date ને આજથી બાદ કરવું વચ્ચેના દિવસોની સંખ્યા આપે છે, એટલે કે days overdue (એક negative પરિણામ એટલે એ હજી due નથી). કોઈ fancy function જરૂરી નથી, date બાદબાકી બસ કામ કરે છે. આ 'dates numbers છે' નું સીધું ફળ છે: રોજિંદા વ્યાપાર સવાલ એક-line arithmetic બની જાય છે.

Watch out

Marks ક્યાં કપાય છે

એ ભૂલવું કે dates serial numbers છે (તો બાદબાકી days આપે છે). TODAY() (date, live) ને NOW() (date+time) અને એક static date (Ctrl+;, થીજેલી) સાથે ભેળવવું. DATEDIF ના units ("Y"/"M"/"D"/"YM") ચોક્કસ age/tenure માટે ન જાણવા. અને એક date column ને જે છુપી રીતે text છે (ડાબી-align!) એક અસલી date ની જેમ માનવો, પછી ગણિત નિષ્ફળ થાય છે (data-types lesson યાદ કરો). alignment તપાસો, પછી ગણો.

Theory

Dates અસલી reports ચલાવે છે

Age, tenure, days-overdue, ageing reports (30/60/90 days), આ બધું date-as-number arithmetic પર ટકે છે. એક વાર તમે dates ને એક ફૂટપટ્ટી પર points તરીકે જુઓ, આ ગોખવું બંધ થઈ જાય છે. આગળનો lesson financial functions પર જાય છે, EMIs માટે PMT અને એક રોકાણ ને આંકવા NPV, અસલી પૈસાનું ગણિત જે એક દુકાનદાર (અને એક BCA graduate) ખરેખર વાપરે છે.

Summary

Key takeaways

  • Excel dates ને serial numbers તરીકે store કરે છે, તો date2 - date1 વચ્ચેના days આપે છે.
  • TODAY() મોજૂદા date પાછું આપે છે (live); NOW() date અને time પાછું આપે છે.
  • DATEDIF(start, end, unit) complete years ("Y"), months ("M") કે days ("D") માં તફાવત આપે છે.
  • '2 વર્ષ 3 મહિના' જેવા ચોક્કસ tenure માટે "Y" અને "YM" જોડો.
  • TODAY() વાપરતી ages આપોઆપ update થાય છે; એક થીજેલા snapshot માટે એક static date (Ctrl+;) વાપરો.
  • યાદ રાખવાની યુક્તિ: dates એક ફૂટપટ્ટી પર દિવસ-numbers છે, તો date ગણિત બસ arithmetic છે.

Study this properly

This page is the lesson to read. In Gri-Learn the same topic is a graded deck: the self-checks are scored and your weak topics are tracked. Free to start.

Start this topic

Already have an account? Sign in

More from Advanced Formulas, Functions, Chart and Data Analysis

Gri-Learn · syllabus-mapped B.C.A. lessons in English, Hindi and Gujarati