{"id":3862,"date":"2019-01-02T18:13:39","date_gmt":"2019-01-02T18:13:39","guid":{"rendered":"http:\/\/officetuts.net\/excel\/?p=3862"},"modified":"2024-03-29T14:18:23","modified_gmt":"2024-03-29T14:18:23","slug":"range-based-on-cell-value","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/","title":{"rendered":"Range Based on Cell Value in Excel"},"content":{"rendered":"\n
Range-Based-on-Cell-Value<\/a>Download File<\/a><\/div>\n\n\n\n

Calculating ranges is easy. But have you ever tried to calculate a range based on the number in a specific cell?<\/p>\n\n\n\n

In this lesson, I\u2019ll show you a formula where you make such a reference.<\/p>\n\n\n\n

Calculate the range based on cell value<\/h2>\n\n\n\n
    \n
  1. Enter numbers from 1 to 10 into the first column.<\/li>\n\n\n\n
  2. In cell C1<\/strong> enter the phrase – Number<\/strong>.<\/li>\n\n\n\n
  3. In cell D1<\/strong> enter the phrase – Result<\/strong>.<\/li>\n\n\n\n
  4. Enter the number between 1<\/strong> and 1048576<\/strong> into cell C2<\/strong>.<\/li>\n\n\n\n
  5. Insert the following code into cell B2<\/strong>.<\/li>\n<\/ol>\n\n\n\n
    =SUM(A1:INDIRECT(CONCATENATE(\"A\",C2)))<\/pre>\n\n\n\n

    This is our result.<\/p>\n\n\n\n

    \"\"<\/figure>\n\n\n\n

    I told you to enter the value between 1 and 1048576 because these are the first and the last row in Excel. If you enter a different value, text, or leave a blank cell, it will return the #REF!<\/strong> error.<\/p>\n\n\n\n

    You can handle this exception by modifying the formula.<\/p>\n\n\n\n

    =IF(AND(C2>=1,C2<=1048576),SUM($A$1:INDIRECT(CONCATENATE(\"A\",C2))),\"bad number\")<\/pre>\n\n\n\n

    Now, if you enter the number outside this range the exception will be handled.<\/p>\n\n\n\n

    \"\"<\/figure>\n","protected":false},"excerpt":{"rendered":"

    Calculating ranges is easy. But have you ever tried to calculate a range based on the number in a specific cell? In this…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[170,190],"yoast_head":"\nRange Based on Cell Value in Excel<\/title>\n<meta name=\"description\" content=\"Learn how to calculate a range based on a specific cell value in Excel. Follow our step-by-step guide and download our free Excel file.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Range Based on Cell Value in Excel\" \/>\n<meta property=\"og:description\" content=\"Learn how to calculate a range based on a specific cell value in Excel. Follow our step-by-step guide and download our free Excel file.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-02T18:13:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-29T14:18:23+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/range-based-on-cell-value.png\" \/>\n<meta name=\"author\" content=\"Tomasz Decker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tomasz Decker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/\"},\"author\":{\"name\":\"Tomasz Decker\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"headline\":\"Range Based on Cell Value in Excel\",\"datePublished\":\"2019-01-02T18:13:39+00:00\",\"dateModified\":\"2024-03-29T14:18:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/\"},\"wordCount\":157,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/range-based-on-cell-value.png\",\"keywords\":[\"file\",\"pinterest\"],\"articleSection\":[\"formulas\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/\",\"url\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/\",\"name\":\"Range Based on Cell Value in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/range-based-on-cell-value.png\",\"datePublished\":\"2019-01-02T18:13:39+00:00\",\"dateModified\":\"2024-03-29T14:18:23+00:00\",\"description\":\"Learn how to calculate a range based on a specific cell value in Excel. Follow our step-by-step guide and download our free Excel file.\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#primaryimage\",\"url\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/range-based-on-cell-value.png\",\"contentUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/range-based-on-cell-value.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Range Based on Cell Value in Excel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Range Based on Cell Value in Excel","description":"Learn how to calculate a range based on a specific cell value in Excel. Follow our step-by-step guide and download our free Excel file.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/","og_locale":"en_US","og_type":"article","og_title":"Range Based on Cell Value in Excel","og_description":"Learn how to calculate a range based on a specific cell value in Excel. Follow our step-by-step guide and download our free Excel file.","og_url":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/","article_published_time":"2019-01-02T18:13:39+00:00","article_modified_time":"2024-03-29T14:18:23+00:00","og_image":[{"url":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/range-based-on-cell-value.png"}],"author":"Tomasz Decker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tomasz Decker","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/"},"author":{"name":"Tomasz Decker","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"headline":"Range Based on Cell Value in Excel","datePublished":"2019-01-02T18:13:39+00:00","dateModified":"2024-03-29T14:18:23+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/"},"wordCount":157,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#primaryimage"},"thumbnailUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/range-based-on-cell-value.png","keywords":["file","pinterest"],"articleSection":["formulas"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/","url":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/","name":"Range Based on Cell Value in Excel","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#primaryimage"},"thumbnailUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/range-based-on-cell-value.png","datePublished":"2019-01-02T18:13:39+00:00","dateModified":"2024-03-29T14:18:23+00:00","description":"Learn how to calculate a range based on a specific cell value in Excel. Follow our step-by-step guide and download our free Excel file.","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#primaryimage","url":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/range-based-on-cell-value.png","contentUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2019\/01\/range-based-on-cell-value.png"},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/formulas\/range-based-on-cell-value\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Range Based on Cell Value in Excel"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/3862"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=3862"}],"version-history":[{"count":2,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/3862\/revisions"}],"predecessor-version":[{"id":13623,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/3862\/revisions\/13623"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=3862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=3862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=3862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}