Referencing a cells value in another formula

Ritik

New Member
Joined
Aug 28, 2022
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
Hello all,

I am trying to reference a cells value in a formula I am trying to use, however I do not think it is working because the cell I want to reference has a formula in it, which is then formatted to give a specific number.

E.G.

Cell B2 has the value I want to reference in my formula. Cell B2 contains =WORKDAY(DATE(A2,A3,0), 1)
Cell A2 contains 2023
Cell A3 contains 1

This formula gives me the first working day of January 2023. I then proceeded to format it so it shows as just a numerical date "2"

Now I want to reference this cell B2 which contains this formula, =WORKDAY(DATE(A2,A3,0), 1) but outputs "2" , to be used in another cells formula with the formula being

=IF(ISNUMBER(MATCH(B2,V2,0)),"Holiday")

Lets say V2 contains a number 2.

If V2 contains 2,it would match with the output of cell B2 (which is a formula, that is then formatted to a numerical day value), it should then display holiday.

however this is not the case, it shows False. When I change the B2 in the formula to 2, it works fine, however I would like it linked to cell B2.

=IF(ISNUMBER(MATCH(2,V2,0)),"Holiday")

Let me know if I can clarify anything.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
that cell will have a full date reference as a Number 44928 2nd jan 2023
BUT when you format you asking excel just to show the day - but underlying is the full date 44928

if you just want the day to be used
then
=DAY(WORKDAY(DATE(A2,A3,0), 1))
will give 2
format as a number or general

or if in B2 you need to keep the full date , then you could change the B2 in the match - to use the DAY() formula directly

=IF(ISNUMBER(MATCH(DAY(WORKDAY(DATE(A2,A3,0),1),V2,0)),"Holiday")

OR

=IF(ISNUMBER(MATCH(DAY(B2),V2,0)),"Holiday")
 
Upvote 0
Solution
How about
Excel Formula:
=IF(ISNUMBER(MATCH(DAY(B2),V2,0)),"Holiday")
The reason your formula doesn't work is B2 contains the date, the cell format is irrelevant.
 
Upvote 0
Thank you for your help @etaf and @Fluff:

I used =IF(ISNUMBER(MATCH(DAY(B2),V2,0)),"Holiday") and it worked perfectly. Thank you so much for your help.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,018
Messages
6,122,703
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top