{
 "id": "personal-expense-tracker",
 "file": "softwiro-personal-expense-tracker.xlsx",
 "title": "شيت مصروفي اليومي البسيط",
 "language": "ar",
 "direction": "rtl",
 "how_it_works": "White cells are typed input; cells whose kind is \"formula\" are calculated and must not be overwritten. Add one record per row under the header row of a record table, keeping the columns in order.",
 "sheets": [
  {
   "name": "ابدأ هنا",
   "formula_cells": 0
  },
  {
   "name": "مصروفي",
   "formula_cells": 56,
   "record_tables": [
    {
     "header_row": 25,
     "first_record_row": 26,
     "sample_rows_filled": 0,
     "capacity_last_row": 44,
     "columns": [
      {
       "column": "A",
       "header": "الفئة",
       "kind": "formula",
       "formula_row_1": "=IFERROR(INDEX('الحدود'!$A$6:$A$20,MATCH(1,'الحدود'!$F$6:$F$20,0))&\"\",\"\")"
      },
      {
       "column": "B",
       "header": "صرفت",
       "kind": "formula",
       "formula_row_1": "=IFERROR(INDEX('الحدود'!$C$6:$C$20,MATCH(1,'الحدود'!$F$6:$F$20,0)),\"\")"
      },
      {
       "column": "C",
       "header": "من الشهر",
       "kind": "formula",
       "formula_row_1": "=IF(OR(B26=\"\",$B$14=0),\"\",B26/$B$14)"
      }
     ]
    }
   ],
   "settings": [
    {
     "label": "تاريخ اليوم",
     "cell": "B4",
     "value": "2026-11-13"
    },
    {
     "label": "نبّهني عند نسبة من الحد",
     "cell": "B5",
     "value": 0.8
    }
   ],
   "results": [
    {
     "label": "أول يوم في الشهر",
     "cell": "B6",
     "formula": "=DATE(YEAR(B4),MONTH(B4),1)"
    },
    {
     "label": "أول يوم في الشهر القادم",
     "cell": "B7",
     "formula": "=EDATE(B6,1)"
    },
    {
     "label": "صرفت النهاردة",
     "cell": "B10",
     "formula": "=ROUND(SUMIFS('السجل'!$B$6:$B$2005,'السجل'!$A$6:$A$2005,B4),2)"
    },
    {
     "label": "عدد المصروفات النهاردة",
     "cell": "B11",
     "formula": "=COUNTIFS('السجل'!$A$6:$A$2005,B4)"
    },
    {
     "label": "صرفت هذا الشهر",
     "cell": "B14",
     "formula": "=ROUND(SUMIFS('السجل'!$B$6:$B$2005,'السجل'!$A$6:$A$2005,\">=\"&B6,'السجل'!$A$6:$A$2005,\"<\"&B7),2)"
    },
    {
     "label": "الحد الشهري",
     "cell": "B15",
     "formula": "=SUM('الحدود'!$B$6:$B$20)"
    },
    {
     "label": "الباقي من الحد",
     "cell": "B16",
     "formula": "=ROUND(B15-B14,2)"
    },
    {
     "label": "نسبة المصروف من الحد",
     "cell": "B17",
     "formula": "=IF(B15=0,\"\",B14/B15)"
    },
    {
     "label": "الأيام المتبقية (مع النهاردة)",
     "cell": "B18",
     "formula": "=IF(AND(B4>=B6,B4<B7),B7-B4,0)"
    },
    {
     "label": "تقدر تصرف كل يوم",
     "cell": "B19",
     "formula": "=IF(B18=0,\"\",ROUND(MAX(0,B16)/B18,2))"
    },
    {
     "label": "متوسط صرفك اليومي حتى اليوم",
     "cell": "B20",
     "formula": "=IF(B4<B6,\"\",ROUND(B14/(B4-B6+1),2))"
    },
    {
     "label": "الحالة",
     "cell": "B21",
     "formula": "=IF(B15=0,\"اكتب حدودك\",IF(B14>B15,\"تجاوزت الحد\",IF(B14>=B15*B5,\"قربت من الحد\",\"ماشي تمام\")))"
    },
    {
     "label": "مصروف بفئة غير مسجلة",
     "cell": "B22",
     "formula": "=ROUND(B14-SUM('الحدود'!$C$6:$C$20),2)"
    }
   ]
  },
  {
   "name": "السجل",
   "formula_cells": 0,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 28,
     "capacity_last_row": 33,
     "columns": [
      {
       "column": "A",
       "header": "التاريخ",
       "kind": "input",
       "examples": [
        "2026-10-28",
        "2026-10-29",
        "2026-10-30"
       ]
      },
      {
       "column": "B",
       "header": "المبلغ",
       "kind": "input",
       "examples": [
        90,
        45,
        130
       ]
      },
      {
       "column": "C",
       "header": "الفئة",
       "kind": "input",
       "examples": [
        "أكل وشرب",
        "مواصلات",
        "قهوة وخروج"
       ],
       "allowed_values": {
        "from_range": "'الحدود'!$A$6:$A$20"
       }
      },
      {
       "column": "D",
       "header": "الدفع",
       "kind": "input",
       "examples": [
        "نقد",
        "محفظة",
        "بطاقة"
       ],
       "allowed_values": [
        "نقد",
        "بطاقة",
        "محفظة"
       ]
      },
      {
       "column": "E",
       "header": "ملاحظة",
       "kind": "input",
       "examples": [
        "غدا",
        "خروجة",
        "سوبر ماركت"
       ]
      }
     ]
    }
   ]
  },
  {
   "name": "الحدود",
   "formula_cells": 63,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 9,
     "capacity_last_row": 22,
     "columns": [
      {
       "column": "A",
       "header": "الفئة",
       "kind": "input",
       "examples": [
        "أكل وشرب",
        "مواصلات",
        "موبايل وإنترنت"
       ]
      },
      {
       "column": "B",
       "header": "الحد الشهري",
       "kind": "input",
       "examples": [
        2500,
        800,
        300
       ]
      },
      {
       "column": "C",
       "header": "صرفت",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",ROUND(SUMIFS('السجل'!$B$6:$B$2005,'السجل'!$C$6:$C$2005,A6&\"\",'السجل'!$A$6:$A$2005,\">=\"&'مصروفي'!$B$6,'السجل'!$A$6:$A$2005,\"<\"&'مصروفي'!$B$7),2))"
      },
      {
       "column": "D",
       "header": "الباقي",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",ROUND(N(B6)-C6,2))"
      },
      {
       "column": "E",
       "header": "النسبة",
       "kind": "formula",
       "formula_row_1": "=IF(OR(A6&\"\"=\"\",N(B6)=0),\"\",C6/B6)"
      },
      {
       "column": "F",
       "header": "ترتيب",
       "kind": "formula",
       "formula_row_1": "=IF(ISNUMBER(C6),IF(C6>0,COUNTIFS($C$6:$C$20,\">\"&C6)+COUNTIFS($C$6:C6,C6),\"\"),\"\")"
      }
     ]
    }
   ]
  },
  {
   "name": "لماذا ما زلت على إكسل؟",
   "formula_cells": 0
  }
 ]
}